In 1929, the American astronomer Edwin Powell Hubble linked the redshift visible in the spectra of distant galaxies, to the constant expansion of the universe.
Hubble suggested that this cosmological red shift is caused by the Doppler Effect, as the space through which the light travels, is stretched out. This would hence indicate the speed of recession of these galaxies -- and, by using Hubble's Law, the distances of the galaxies.
A second mechanism for red shift is the gravitational red shift, also called the Einstein shift. It was predicted by Albert Einstein with his general relativity theory -- According to which periodic processes are slowed down in a gravitational field. This Einstein Shift is noticeable in the spectra of massive, compact stars, such as white dwarfs.