I am trying to understand how spectrometers or spectroscopy can be used to calculate the surface composition of asteroids for the purposes of asteroid mining.
It uses the same fundamental conept of mapping between emission-line wavelengths to certain transitions. Similar as we know that 21cm line is the transition of spin-flip of a neutral hydrogen.
Infrared (IR) regions is typically where the molecular lines are seen. Wikipedia has good and brief discussion.
Asteriods are cold so we expect molecules to form. Therefore, we expect to see lines in IR region the most. To be more specific, surface temperature of asteriod is ~346 K, which is equivalent to ~83714 A at max emission (assuming blackbody radiation and following Wien's law); this is IR.
Also note that, what we see is the surface of the asteriod, not the inside.
To add to KB's answer: By and large the method involves looking at the IR absorption spectrum. If you see a set of lines which correspond to a known mineral, then you conclude that mineral is part of the asteroid's composition. This assumes you know what's currently illuminating the asteroid (spectral irradiance). If you're looking at the dark side, then it's a similar analysis but looking for known gaps in the not-quite-black-body exitance for a given mineral specie.