A mass spectrometer involves three primary functions:
1. The vaporization of your unknown compound M into gas M.
2. The ionization of gas M into the molecular ion or radical cation.
3. The detection of all gas ion fragments.
Analysis of all gaseous ions helps to create a mass spectrum.