The sound you already know
You have already met this effect with your ears. An ambulance races toward you and its siren sounds high and urgent; the instant it passes and pulls away, the pitch drops to a lower wail. The siren itself never changed its note. What changed is that each sound wave had a little less distance to travel to your ear while the ambulance approached — so the crests arrived bunched up, more per second, a higher pitch — and a little more distance once it was leaving, so they arrived stretched out, a lower pitch. That bunching-and-stretching of waves by motion is the Doppler effect, and the astonishing thing is that light does exactly the same.
Carry the picture over to light. From an earlier guide in this rung you know that a color is really a wavelength — the distance from one crest of the light wave to the next. When a glowing source moves toward you, each successive crest is launched from a little nearer, so the crests pile up: the wavelength you receive is shorter, shifted toward the blue end of the spectrum. We call this a blueshift. When the source moves away, the crests are spread out, the wavelength is longer, and the light is shifted toward the red end — a redshift. This is the Doppler shift of light.
Spectral lines: nature's printed ruler
Here is the problem the Doppler shift seems to pose: if a star's whole rainbow simply slides a hair toward red or blue, how could you ever notice? A smooth rainbow that shifts looks like the same smooth rainbow. The answer is that starlight is not a smooth rainbow. Stamped across it are sharp dark gaps — places where specific wavelengths are missing, drunk up by particular atoms in the star's outer layers. Each such gap is a spectral line, and together they form an absorption-line spectrum: a barcode of fine dark lines printed on the rainbow.
What makes these lines priceless is that each element prints its barcode at exactly fixed, known wavelengths. Hydrogen always absorbs at the same set of wavelengths; a particular pair of sodium lines always sits at the same yellow spot; calcium prints two heavy lines deep in the violet. We know these rest wavelengths to staggering precision because we can measure them in a glowing tube in the laboratory, here on a motionless bench on Earth. So nature has handed every star a printed ruler with known markings — and a shifted ruler is something you absolutely can detect.
So the trick is simple and powerful. Photograph a star's spectrum, find its barcode of lines, and identify which element made each line by the pattern. Now compare where each line actually sits to where the laboratory says it belongs at rest. If every line in the pattern is nudged together toward longer wavelengths, the star is receding; if every line is nudged together toward shorter wavelengths, it is approaching. Crucially, the whole pattern moves as one rigid unit, by the same fractional amount — that lockstep is exactly how you tell a genuine motion shift from a line that merely looks odd.
From a shifted line to a speed
Now make it quantitative, because this is where the Doppler shift becomes one of astronomy's sharpest tools. The size of the shift is not random: the fractional change in wavelength equals the source's speed along your line of sight divided by the speed of light. Double the speed and you double the shift. So measuring how far a line has moved hands you the speed directly. This particular speed — the part of the motion straight toward or away from you — is the radial velocity, and reading it off the spectrum is measuring radial velocity from spectral lines.
delta-lambda / lambda(rest) = v(radial) / c observed - rest speed toward/away ---------------- = ----------------- rest wavelength speed of light (c about 300,000 km/s) line moved to LONGER wavelength -> redshift -> moving AWAY line moved to SHORTER wavelength -> blueshift -> moving TOWARD
Two honest limits keep this from being magic. First, the Doppler shift sees only the radial part of the motion — the toward-or-away part. A star streaking purely sideways across the sky, never nearing or receding, produces no shift at all; that crosswise motion must be caught by other means over years. Second, real lines have a slight natural width and the instrument adds a touch of blur, so there is always a smallest shift you can reliably trust. Modern instruments are extraordinary, steady enough to register a star wobbling by a walking pace — but the floor is never zero.
That sensitivity is why the Doppler shift does so much of astronomy's heavy lifting. Watch a star's lines swing rhythmically red, then blue, then red again, and you have caught it circling an unseen companion — a method that finds hidden binary stars and weighs them. Make the wobble tiny enough and the unseen partner is a planet, gently tugging its star to and fro: this is how many of the first worlds around other stars were found. The same shifted lines that clock a star's speed quietly reveal what is orbiting it.
The galaxies almost all run red
Now point the same instrument not at a star but at a whole galaxy, far beyond our own. Photograph its spectrum, find the same familiar barcode of lines, and a strange pattern emerges. Almost every galaxy is redshifted — its lines slid toward longer wavelengths, as if it were rushing away from us. And the fainter and more distant the galaxy, the larger its redshift. Galaxies twice as far away show, on average, twice the shift. This tidy proportion between redshift and distance is [[hubbles-law|Hubble's law]], and it is one of the great discoveries of the twentieth century.
The naive reading is that every galaxy is flying away through space and we sit at the center of the stampede. Resist it — it is wrong, and the error matters. If we sat at a true center, we would be in a uniquely special spot, which observers on any other galaxy would find too: yet they would each see exactly the same thing we do, every other galaxy receding from them. No location is special. The honest picture is not galaxies hurtling outward through a fixed space, but something subtler that we must spell out carefully, because almost every popular account of it goes slightly astray.
Why this redshift is not a Doppler shift at all
Here is the careful truth, and it is the single most important idea in this guide. The redshift of distant galaxies is not the ordinary Doppler shift of something moving through space. It is a [[cosmological-redshift|cosmological redshift]]: the light's wavelength is stretched because the space it travels through is itself expanding while the light is in flight. The galaxies are not, for the most part, speeding through space away from us. Space between us and them is growing, and the light wave riding across that space gets stretched along with it — its crests pulled farther apart, its color reddened — simply by the lengthening of the road it traveled.
Why does the distinction matter so much? Because it dissolves several puzzles at once. There is no center to flee from, because no galaxy is fleeing through space — every observer everywhere sees the same outward pattern, which is exactly what uniform stretching of space predicts. And for the most distant galaxies the wavelength can be stretched to several times its original length, which a naive Doppler reading would translate into a speed faster than light. That is not a paradox: it is the signal that the Doppler formula simply does not apply, because nothing is moving through space that fast. The wavelength grew because space grew, by whatever factor space has expanded since the light set out.
Hold both ideas together honestly, and do not let them collapse into one. Nearby — within our galaxy, among the planets, in a binary star — the shift you measure is a true Doppler shift, the bunching and stretching of waves by real motion through space, and the simple speed formula above is exactly right. On the largest scales, the galaxy-wide redshift is the stretching of space itself, and the Doppler formula is the wrong tool. A real galaxy's spectrum can even carry both at once: a small Doppler wobble from its own local motion, riding on top of a large cosmological stretch. Telling these apart is the work of the next rungs, where you will meet how this expanding universe began and how far back its light lets us see.