Light guns are cool, they work the opposite way to how you'd imagine them working, the screen shoots the gun is how they work.
The image on the monitor is made out of one dot whizzing left to right then turning off and dropping down a line and going back left and turning on and going left to right again until it reaches the bottom of the screen and then it starts again from the top on the next frame of video.
When you pull the trigger the computer goes "Right, next frame, it's all gonna be white," and after it's done drawing the current frame and waited for the vertical blanking interval it starts a stopwatch. There's a photodiode in the gun behind the lens, and when that photodiode hits its absolute peak "This is the brightest I've seen this sixtieth of a second" the computer stops the stopwatch and does the maths and goes right, that was the brightest when I was drawing THIS bit of white, so that's where this player shot. The screen shoots the gun and the gun just says when.