Answer:
Doppler effect occurs when there is relative motion between the source and the observer, there is apparent change in frequency or wavelength of the wave. When, the source and observer come closer, the apparent frequency increases and wavelength decreases that is the spectrum is blue shifted. When the two move far apart, the spectrum is red-shifted which means the frequency decreases and wavelength increases.
We obtain the spectrum of bodies in the universe. If the spectrum is red shifted, it indicates that the body is moving away from us while a blue-shifted spectrum indicates that the body is moving towards us.