Spectroscopy and Galaxy Velocities Measurements of galaxy colors give only coarse information about the spectrum. Detailed information requires spectroscopy. These lines set up an interference pattern due to diffraction. Refraction and interference are due to the wave properties of light. Atoms in the star's atmospheres selectively absorb light at certain wavelengths.
Atoms absorb light only at particular energies.
This is explained by quantum mechanics. Thus, the specrum of a star is not continuous, but is marked by dark bands known as absorption lines. Galaxies consist of stars and interstellar gas. Most galaxies have spectra dominated by the combined light of all their stars. Because the stars have absorption spectra, so do these galaxies.