Light travels at a finite speed of 3×108 m/s (299,792,458 m/s to be exact). When a light signal (such as a radio pulse) is directed at a nearby planetary body part of the signal will be reflected back. By timing how long it takes this light echo to return and then dividing this time by 2 and multiplying by the speed of light, the distance to the planet can be determined. The animation below shows this simple behavior.
Radar ranging is a challenging technique to implement. The atmosphere poses difficulties and this is one reason that radio waves are used as the atmosphere is largely transparent to certain radio frequencies. The second difficulty is signal strength. The signal will start to spread out as soon as it is sent. The more distant the object, the more spread out the beam will be when it arrives and the more spread out the echo will be when it is received. The end result is a very weak signal. Strong signals must be broadcast and and very sensitive detectors are needed to detect the echo. Radio waves fit both these categories much better than visible light (one exception is an visible laser pulse sent to the nearby Moon). Thus, this technique is known by the acronym RADAR -- radio detection and ranging.
When the signal received from a large round body like a planet is sufficiently strong, additional information may be gathered. The entire echo will be Doppler shifted by the relative velocities of the the Earth and the target body. The radar pulse will hit the planet at slightly different times because of the curvature of the planet resulting in slight differences in echo reception time. If the planet is rotating, the echo will have additional small Doppler shifts based on this motion. In the figure to the right where the planet is rotating counter-clockwise, the pulse will be slightly blueshifted on the left-side of the echo compared to a slight redshifting of the right-side of the echo. Radar data such as this taken in 1965 showed that Mercury has a 3:2 spin orbit resonance -- it revolves around the sun in 88 days and rotates in 59 days. This techique has also been applied to all nearby, large planetary bodies including the moon, Venus, Mars, the Galilean satellites, the rings of Saturn, and Titan.