Here's how it works:
* Doppler Effect: Just like the sound of a siren changes pitch as it moves towards or away from you, light waves also change frequency depending on the relative motion of the source and observer.
* Redshift: When a light source moves away from us, the light waves are stretched, causing the wavelengths to increase. This shift towards longer wavelengths (redder colors) is called redshift.
* Blueshift: Conversely, if a light source is moving towards us, the light waves are compressed, causing the wavelengths to decrease. This shift towards shorter wavelengths (bluer colors) is called blueshift.
Therefore, a star whose spectral lines are redshifted indicates that the star is moving away from Earth.