How do diffraction gratings tell us information about distant stars and galaxies?
The connection between diffraction gratings and stars is found in spectroscopy, which is the study of the relative brightness of an object at each wavelength of light (electromagnetic radiation) it emits or absorbs. Each element has a unique 'fingerprint' determined by the allowable electron energies surrounding its nucleus, causing it to emit or absorb specific wavelengths of light.
Information about a star's composition, magnetic fields, motion, temperature and pressure can, therefore, be obtained by analyzing its light's intensity at each wavelength. To allow that analysis, the star's total emitted light must be broken down into individual wavelengths just at a prism or rainbow separates sunlight into distinct wavelengths, or colors.
A prism takes advantage of dispersion, which results from the fact that different colors of light travel through glass at different speeds, depending on wavelength.
A diffraction grating can accomplish the same separation of colors because of diffraction. A light ray reflected (or transmitted) by a grooves in the grating will either interfere constructively or destructively with the ray from the groove next to it, depending on the angle it emerges and the light's wavelength. You can see this color separation by looking at white light reflected from the grooves of a CD.
The advantage of a grating over a prism is that light passing through a prism can be absorbed (and lost), while a grating's reflected light spectrum does not have to be transmitted through any material. It is the same advantage of using a reflecting telescope over a refracting one.
Paul Walorski, B.A., Part-Time Physics Instructor
'A scientist is happy, not in resting on his attainments but in the steady acquisition of fresh knowledge.'