Many mass spectrometers (like our Shimadzu 5050A) operate by shooting an electron stream at a sample causing the molecules to fragment. The ions formed have a +1 charge because of the electron lost by the broken bond. Masses of interest are guided through a quadrupole, four rods that create oscillating electric fields: a filter that permits only certain ions to get to the detector. The rest bounce off the trajectory path to be sucked up by a turbo pump (reminiscent of the sarlacc scene in ROTJ). The result is a mass spectra depicted by a clean mass to charge ratio (m/z). Here is a great video created by NASA that illustrates this process: