In this post I will try to explain how it works. There are two things you have to realize before you understand why and how the RV method can be used to detect planets.
(1) Although we usually say that a planet orbits a star, this is only half true. Actually, the planet and the star move around a common center of mass. So not only the planet is moving, but the star itself is moving too; however, it is of course not moving as much because it has much more mass.
(2) The light emitted by a moving object is shifted in wavelength/frequency. This is called the Doppler effect and works for all kinds of waves, e.g. sound waves and light. Because the star is moving, the light it emits is shifted to longer wavelengths when moving away from the observer and to shorter wavelengths when moving towards the observer. Light shifted to longer wavelengths is called red-shifted, for shorter wavelengths it is called blue-shifted.
Because the RV method really is about movement, I prepared a little video instead of a static diagram this time. It shows that planet and host star move around a common center of mass indicated by the black cross, and that the light coming towards the observer is shifted in color because of the movement of the star. Only the movement in the direction of the observer is important, which is called the radial movement. This is where the method gets its name from: we only measure the radial component of the velocity.
In the movie the stellar light is not shifted when the planet is exactly behind or in front of the star. In these positions the radial velocity of the star (and the planet too) is zero and no wavelength shift is caused. The higher the velocity of the star in the direction of the observer is, the higher is the wavelength shift.
This also means the RV method works best if we look at a planetary system edge-on. The observer's viewing angle on the system is called inclination i. If i=90° we look at the system directly edge-on and the movement of the star is largest. If i=0° we look at the system from above and the star is not moving in our direction at all - and the RV method does not work anymore.
I tried to illustrate this in a second movie. Now the inclination of the system in respect to the observer has changed and our viewing angle is close to 0°. The radial movement of the star (in direction towards and away from the observer) is much smaller now and, thus, the wavelength shift is smaller too.
This inclination plays an important role, because observers usually do not know its exact value. However, the radial velocity of the star depends on it and, therefore, also the measured mass of the planet depends on the inclination. This is why planetary masses derived with the RV method are described as m sin(i). m is the true mass of the planet and sin(i) is the sine of the inclination. Observers do not measure the true mass, but its "projection" on the angle i. So if we measure a low mass for a planet, this can mean two things: either we really have a low-mass planet with an angle i close to 90°, or we have a higher mass planet with an angle closer to 0° (or 180°). In the end we cannot be sure what kind of planet it is until we know what the inclination is.
The RV method only works as good as we can measure the radial velocity of the star, and this is where the really difficult part begins. If you want to measure the radial velocity of the Sun caused by the gravitational drag of the Earth, you have to have an instrument measuring velocities with a precision of about 10 cm/s. This is tiny. Just compare it to the preferred walking speed of humans, which is already more than a factor 10 higher. The rotation speed of the Sun is roughly 2 km/s. The radius of the Sun is 700000 km, which means you have to measure a change in distance of 10-10 of the radius of the Sun per second. Or, finally, make yourself aware that Earth orbits the Sun with a speed of about 30 km/s.
Today the best instruments measure radial velocities down to below 1 m/s. Wavelength-stabilized spectrographs observe spectra of the stars and the spectral lines within these spectra can be used to determine their shift due to the Doppler effect. It might be hard to understand how difficult it is to get down to 1 m/s - or even 10 cm/s - if one has never tried to get velocities out of a spectrum. Maybe I can try to show this is one of my next posts in more detail, but think about it that way: the minimum width of a spectral line for the Sun with a rotation velocity of 2 km/s is at least a few km/s. This means you want to measure the position of the line more than a factor 1000 better than its width. The reason why this works at all is that the spectra have hundreds or even thousands of lines.