While the very existence of visible light allows for the viewing of celestial bodies, not enough credit is oft given to the true capability of light’s full spectrum.
Spectroscopy is an imaging and scientific method of measurement that involves the unique spectra that occur when light comes into contact with an object or substance of interest. Two different kinds of spectra, absorption and emission spectra, are created by and can be used to identify different materials the light passes through or interacts with.
When light is absorbed by these different materials of interest, characteristic absences in the full spectrum occur, these positions then are used to quantify and characterize.
Spectroscopy was used in the Deep Impact mission, where the actual flyby satellite was equipped with an infrared spectrometer that was aimed at the cloud of gas and material formed from the impact of the comet observed and the crash lander. A characteristic spectrum “fingerprint”, representative of the composition of the comet’s core, can then be identified and analyzed.
For more on the usage of spectroscopy in space exploration, read more here at NASA’s official website.