Here's how it works:
* Prism: A prism is a triangular piece of glass or other transparent material. Light enters the prism and is refracted (bent) at different angles depending on its wavelength. This separation of colors is what creates the spectrum.
* Diffraction Grating: This is a surface with many closely spaced parallel lines or grooves. Light waves diffract (bend) as they pass through the grating, and the different wavelengths diffract at different angles, again creating a spectrum.
So, both prisms and diffraction gratings can be used in a spectroscope to create a spectrum of colors.