Light comes in a rainbow of colors. Starlight typically looks white because all those colors are mixed together to make white light. Astronomers love to study the different colors of starlight because they contain a great deal of information. How different colors are absorbed, shifted or otherwise changed tells us about the composition, history and evolution of stars. Fortunately there are a couple of ways we can spread apart the colors of starlight in order to study them.
One way is through a simple piece of glass known as a prism. When light enters a material such as glass, its effective speed decreases. Once consequence of this is that if light enters the glass at an angle it changes direction slightly. If you’ve ever driven a car where one side hits gravel or snow (making that side of the car move more slowly) you might notice how the car tends to pull toward that direction. In the same way, the light is pulled to one direction because of the slower speed. It turns out that the change in speed depends upon the color of the light, so each color is deflected by a slightly different amount. As a result, white light entering a prism is spread out into a rainbow. This effect has been known throughout history, and inspired Newton to study the relation between color and light.
Another way to split light into colors is through a diffraction grating. This device relies upon the wave properties of light. A diffraction grating consists of a pattern of gratings that allow light to pass through certain parts but not others. It’s kind of like a picket fence with evenly spaced gaps between each slat. One of the properties of light waves is that they superpose. If two waves happen to be waving in the same way (in phase) they add up and make the light brighter. If they are waving in opposite ways (out of phase) they cancel each other out and might the light dimmer. As light passes through a diffraction grating it spreads out in different directions. In some directions the light is in phase and makes the light bright, and in other directions it’s out of phase and cancels out. Different colors of light have different wavelengths, so the directions producing bright light vary with color. As a result, white light entering a diffraction grating spreads out into a rainbow of colors. Diffraction gratings have an advantage over prisms in that the angle for a particular color depends upon the spacing of the grating, so we can control how much spread the colors have.
While both prisms and diffraction gratings have been used in astronomy, they pose a challenge for modern telescopes. In order to produce high resolution images, modern telescopes use sophisticated optics to focus light precisely onto detectors. Both prisms and diffraction gratings spread colors apart by changing their direction, making the light out of focus. So astronomers have devised the grism, which can spread colors into a spectrum while maintaining a reasonable focus. A “grism” is a portmanteau of grating and prism, since it uses both a diffraction grating and a prism to spread light into colors. It turns out that while both devices spread light into colors, they do so in opposite ways. A prism deflects violet light more than red, while a diffraction grating deflects red more than violet. By combining the two light can be spread apart while canceling out the overall direction. As a result the light simply spreads into colors without changing its overall direction. So you get a rainbow of colors without significantly affecting the optics of your telescope.
It’s a clever bit of engineering that has greatly improved our study of the stars.