Here's why:
* Doppler Effect: The Doppler effect describes the change in frequency (and therefore wavelength) of a wave as the source of the wave moves relative to an observer.
* Redshift: When a light source moves away from an observer, the waves are stretched out, resulting in a shift towards longer wavelengths (redder colors).
* Absorption Lines: Stars emit a continuous spectrum of light, but certain wavelengths are absorbed by the elements in their atmospheres. These absorbed wavelengths appear as dark lines (absorption lines) within the spectrum.
* Spectral Shift: As the star moves away, the absorption lines shift towards longer wavelengths (redshift) because the light waves are stretched.
In summary: The farther away a star is moving, the greater the redshift of its spectral lines. This redshift provides a way to measure the velocity of stars and other celestial objects.