There are a few different types of light guns that are used.
First is the Guncon 1 and 2 style gun, used on CRT monitors and televisions. This gun uses an electron beam to excite phosphor inside of the monitor, and the game system calculates target position based on the area brightened by the gun. Unfortunately this technology doesn't work for DLP, plasma and LCD monitors
Next we have the Top-gun style guns, which use either one or two sets of IR lights to calculate coordinates. This style works on all types of televisions. Other variations are the Wii remote, the Guncon 3, and the Ultimarc Aim-Trac. Guns are calibrated based on the height and distance the gun is shot. If distance and/or height of the gun change, then innaccuracy of the gun can occur.
Last is a positional gun such as used in Operation Wolf and Revolution X. They are actually analog joysticks and read coordinates based off of the values in the potentiometers.