I knew it had to be using the Doppler Effect somehow. You know when you are driving along and you hear a fire engine or police siren behind you, and how the pitch shifts as the emergency vehicle passes you? That's the Doppler effect on sound waves.
What happens is, the wavelength of the sound gets compressed as the siren approaches you. Conceptually, the siren is producing a sound wave that peaks every so often (hundreds or thousands of times each second). In the case of a stationary siren, these wavefronts would be equally spaced, but in the case of a moving siren, the wavefronts are going to be squished together in the direction the siren is going, and spaced farther apart in the opposite direction.
Mathematically speaking, we know the wave equation: v = f, where v represents the velocity of the wave, is the wavelength, and f is the frequency. Let's suppose, to keep things simple, that you (the observer) are stationary, and the siren is moving. The frequency of the wave that you observe is proportional to the velocity of the observed wave divided by the frequency of the observed wave (i.e., fo = vo/o). The velocity of the wave is constant; the siren isn't pushing the air faster, it's altering the location and frequency of the wavefronts. So vo = v (a constant). How does the movement of the siren change the wavelength of the wave? Well, there is some amount by which the wavelength o gets changed from the at-rest wavelength ; let's call that a. So o = -a, making our equation
fo = v/(-a).
The shift in wavelength, a, has to be proportional to the velocity of the siren, vs (i.e., vs = af). We can substitute v/f for , and vs/f for a, by solving for the wavelength in the wave equation. Thus we obtain
fo = v/(v/f - vs/f)
fo = (v/(v-vs)) f.
We can go through this exercise again, with the siren stationary and the observer moving, and obtain the equation
fo = ((v-vo)/v) f,
and then combine the two equations into the more general
fo = (v-vo)/(v-vs) f.
Of course, a radar gun uses electromagnetic waves, not sound waves. When v is much, much bigger than vo or vs, then we can simplify this equation somewhat. Suppose we multiply the right-hand side, ((v-vo)/(v-vs)) f, by (v+vs)/(v+vs), or in other words, by 1. Then we obtain
fo = f (v-vo)(v+vs)/((v-vs)(v+vs))
= f (v2 - (vs-vo)v - vovs)/(v2-vs2).
This doesn't look very nice or helpful, but since the velocities of the source and the observer are so tiny compared to the velocity of the wave, then we can cancel out any second-order (i.e., squared) terms in vo and vs:
fo = f (v2 - (vs-vo)v -
So finally, we end up with the much simpler equation
fo = f (1-(vs-vo)/v).
This is the equation that is used in a radar gun. The radar gun shoots out some radio waves, which bounce off your speeding car. The frequency shift is used to determine the speed of your vehicle.
It is slightly more complicated, however, when faced with identifying the actual culprit who is speeding, as well as correcting for certain types of errors that crop up when the radar is not trained in the exact direction of the car's velocity, etc. But combining the radar gun readings with other techniques, such as observation, speed matching, etc., police are able to catch speeders with better and better accuracy.
How Radar Guns Work
Doppler Effect (Wikipedia)
Doppler Shift (Eric Weisstein's World of Physics)