Light from a star does not contain all the wavelengths of the electromagnetic spectrum. Elements in the star absorb some of the emitted wavelengths, so dark lines are present when the spectrum is analysed. Different elements produce different patterns of dark lines. The diagram shows part of the emission spectrum of light from the Sun.
Astronomers can observe light from distant galaxies. When they do this, they see it is different to the light from the Sun. The dark lines in the spectra from distant galaxies show an increase in wavelength. The lines are moved or shifted towards the red end of the spectrum. This effect is called red-shift. The diagram shows part of the emission spectrum of light from a distant galaxy.
Astronomers see red-shift in virtually all galaxies. It is a result of the space between the Earth and the galaxies expanding. This expansion stretches out the light waves during their journey to us, shifting them towards the red end of the spectrum. The more red-shifted the light from a galaxy is, the faster the galaxy is moving away from Earth.