Doppler Effect
You may have experienced hearing an ambulance siren and noticing that the ambulance is getting closer. As the ambulance approaches, the pitch of the siren becomes higher, and as it moves away, the pitch becomes lower. In other words, when an ambulance approaches while sounding its siren, the sound waves have a shorter wavelength (higher pitch), whereas when it moves away, the sound waves have a longer wavelength (lower pitch).
A similar effect occurs with light. When a star moves away from an observer, the wavelength of its light becomes longer than its original wavelength, shifting its spectrum toward the red end. This phenomenon is called redshift. By analyzing the spectra of light from distant galaxies, scientists discovered that the universe is expanding.