Spectroscopy is the study of light as a function of length of the wave that has been emitted, reflected or shone through a solid, liquid, or gas.
To be analysed the chemical is heated, because each chemical glows differently. The various wavelengths of the glow make a color spectrum which differs in some detail from other chemicals. Spectroscopy separates and measures the brightness of the different wavelengths. It can identify the chemicals in a mixture, and determine some other things, such as how hot the thing is.
Spectroscopy allows scientists to investigate and explore things that are too small to be seen through a microscope, such as molecules, and the even smaller subatomic particles like protons, neutrons and electrons. There are special instruments to measure and analyze these light waves.