It's a combination of the flashing lights, sounds and you concentrating on the screen so hard. I have this when I am writing a novel and have been staring at the screen for two hours straight.
Sit further back from the screen, that might help.
See if you can dim the contrast and lightness of the screen to make it easier on the eyes.
Take a break every hour at least and whenever a headache is coming on.
Don't ever play for more than two hours in a row.
Keep the sound at a safe level.
Make sure you are sitting comfortably, and you're not awkward in any way.
If this continues it could be more serious, I suggest ditching the games for a month or two till it wares off if it gets worse.