Radar
One way of finding the distance to a remote object is to send a pulse of radio waves out and time how long it takes to receive a reflection. Knowing that radio waves travel at 3 x 108 m/s, just like all electromagnetic waves, we can calculate the distance to the object.
This is known as "active" radio astronomy. We are actually producing signals, not just passively receiving signals originating from somewhere else.
At a particular time a signal is aimed at Mars and a reflection is detected after 5 minutes. The distance to Mars must be half of 3 x 108 x (5 x 60) = 4.5 x 1010m.
This method has been used to measure the distance to objects within our solar system such as the Moon, the planets and comets.
The return signal is weak for two reasons:
1. The signal sent out gets weaker with distance so after travelling a very large distance there isn't a lot left.
2. Only a very small part of the signal is reflected.
For these reasons this method is not much use for objects in the outer parts of the solar system and beyond.
Other uses
Imagine a large asteroid is heading towards the Earth. We can use radar to measure its speed towards us. Simply measure its distance at two different times. Its speed will be the difference in distance divided by the time between the readings.
The surface of Venus has been accurately mapped, despite its dense atmosphere, by radar signals from probes in orbit around the planet.

pics NASA