radial velocity
When an ambulance races past, its siren sounds higher as it approaches and lower as it recedes. Light does the same: a source moving toward you has its waves crowded a little shorter (shifted toward blue), and a source moving away has its waves stretched a little longer (shifted toward red). The radial velocity is the part of an object's motion straight along the line of sight — toward us or away from us — and spectral lines let us measure it with astonishing precision.
Here is why lines are the key. We know the exact rest wavelengths of an element's lines from the laboratory; the sodium D line, for instance, sits at 589.0 nm. If we observe that same line in a star slightly shifted — say to 589.2 nm — the size of the shift tells us the star's speed along our line of sight, through the simple Doppler relation: the fractional change in wavelength equals the velocity divided by the speed of light. A whole forest of lines all shifting by the same fraction confirms the measurement and pins down the velocity to within metres per second.
Radial velocity is one of the most productive measurements in all of astronomy. It reveals how stars orbit one another in binaries, how stars swarm inside clusters and galaxies, and, most famously, how galaxies stream apart in the expanding universe — Hubble's law was built on radial velocities. It even finds planets: a star wobbles ever so slightly under the tug of an unseen world, and that tiny back-and-forth radial velocity, just metres per second, betrays the planet's presence.
A line known to sit at 589.0 nm in the lab, observed at 589.2 nm in a star, reveals the star receding at about 100 km/s — the shift of 0.2 nm in 589 nm equals 100 km/s out of 300,000.
A shifted line is a speedometer: how fast the source moves toward or away from us.
Radial velocity measures only motion along the line of sight; sideways motion across the sky leaves the lines unshifted and must be found by other means. And for very distant galaxies the cosmological redshift is the stretching of space itself, not a true velocity through space.