An ambulance siren sounds higher as it comes toward you and lower as it goes away. The siren never changes; the waves reaching you do. The speed of sound is set by the air (What Sets a Wave's Speed), so motion changes the spacing of the crests you receive. As in Sound: Pitch and Loudness, the frequency you hear is the pitch.
🔑 Key idea
$$f' = f\,\frac{v \pm v_o}{v \mp v_s}$$ Use the upper signs when source and observer move toward each other, the lower signs when they move apart. Here $v$ is the speed of sound, $v_o$ the observer's speed and $v_s$ the source's. Approaching raises the pitch.
A moving source. Crests bunch up ahead and spread out behind, so the observer ahead hears a higher pitch.
💡 Why it works
A source with frequency $f$ sends a crest every $T = 1/f$. If it moves toward you at $v_s$, each crest starts $v_sT$ closer than the one before, so the crests arrive $\lambda' = (v - v_s)T$ apart. They still move at $v$, so you hear $f' = \frac{v}{\lambda'} = f\frac{v}{v - v_s}$. A moving observer meets crests more often: $f' = f\frac{v + v_o}{v}$.
⚠️ Common mistake
Thinking the pitch keeps rising as an approaching source gets closer. At constant speed the higher pitch is steady; it drops suddenly to a lower steady pitch as the source passes you. Check with the formula: nothing in it depends on the distance.
✏️ Worked example: An ambulance
A $600\ \text{Hz}$ siren moves at $30\ \text{m/s}$. What do you hear as it approaches and as it moves away? ($v = 343\ \text{m/s}$.)
Approaching (upper sign in the denominator): $$f' = 600\,\dfrac{343}{343 - 30} = 600(1.096) = 658\ \text{Hz}.$$
Light does the same. Light from a galaxy moving away arrives with longer wavelengths (redshift), which is how astronomers measure the motions of stars and galaxies.
Practice
Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.