One of the biggest discoveries in astronomy was that of the nature of nebula. In the early days, it was unclear whether nebulae were under-resolved stars or gas clouds. It was believed that the former was the more likely explanation. So, it was a big deal when it was demonstrated that the nebulae had distinct wavelengths, i.e. they were emission sources with discrete wavelengths, and not continuum emitters. Planetary nebulae are suitable for this sort of experiments. Here is an image of M57, the Ring Nebula, taken with a diffraction grating.
M57 Ring Nebula Spectrum Image by
Cyrus Beh, on Flickr
The orange arrow and oval show the position of the diffracted image of the nebula, which shows not a smear, as with stars, but rather a fairly well-defined image. This was the clue that they were in fact gases excited by nearby stars. To determine the wavelength of the emitted light, and hence the type of gas involved, we can calculate it using the spectroscope.
M57 Ring Nebula Spectrum by
Cyrus Beh, on Flickr
The wavelength of the diffracted image is around 500 nm, corresponding to the O-III emission line. That is, the gas can be identified to be oxygen, though erroneously identified as a new element dubbed "nebulium" in the 1860s when first observed.