It also gives us the ages of the clusters. Knowing the cluster distances, we can establish period-luminosity relations for the Cepheids. We can identify Cepheids in nearby galaxies as well. In Hubble's day this took us to about 1 Mpc. 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.