The light from each star is directed through a prism to produce a spectrum. Each of the spectra has a set of absorption lines created by the presence of hydrogen in the stars' atmospheres.