The absorption of electromagnetic radiation characterizes IR, visible ,uv, and NMR spectroscopy.
A source of radiation is detector, processed, often by fourier transform method displayed as a spectrum.
Mass spectrometry is rather different.
The spectrum consists of a record of ion currents as a function of molecular mass.
This spectral data can be generated in many different ways.