Video demo of the UCSD computational mass spectrometry tool.
I have copied the accompanying article from wikipedia. The link to the wikipedia page is given below.
The earliest devices that measured the mass-to-charge ratio of ions were called mass spectrographs because they were instruments that recorded a spectrum of mass values on a photographic plate. Removing several letters, such as the bound morphemes and free morphemes, and combining the lingustical roots of spectr-um and phot-orgraph-ic plate creates the word spectrograph. A mass spectroscope is similar to a mass spectrograph except that the beam of ions is directed onto a phosphor screen. The suffix -scope here denotes the direct viewing of the spectra (range) of masses. A mass spectroscope configuration was used in early instruments when it was desired that the effects of adjustments be quickly observed. Once the instrument was properly adjusted, a photographic plate was inserted and exposed. The term mass spectroscope continued to be used even though the direct illumination of a phosphor screen was replaced by indirect measurements with an oscilloscope. mass spectroscopy has been used in the past, and is a strictly correct etymology, literally an instrument for the viewing of a range of masses, but is now discouraged due to the possibility of confusion with light spectroscopy. The terms mass spectroscopy and mass spectrometry are currently used, although the latter is strongly preferred. Mass spectrometry is often abbreviated as mass-spec or simply as MS.
Different chemicals have different masses, and this fact is used in a mass spectrometer to determine what chemicals are present in a sample. For example, table salt (NaCl), may be vaporized (turned into gas) and ionized (broken down) into electrically charged particles (Na+ and Cl-), called ions, in the first phase of the mass spectrometry. The sodium ions are monoisotopic, with mass 23u. Chloride ions have two isotopes of mass 35u (~75%) and mass 37u (~25%). They also have a charge, which means that the speed and direction may be changed with an electric or magnetic field. An electric field accelarates the ions to a high speed. After this, they are directed into a magnetic field which applies a force to each ion perpendicular to the plane defined by the particles' direction of travel and the magnetic field lines. This force deflects the ions (makes them curve instead of traveling in a straight line) to varying degrees depending on their mass-to-charge (m/z) ratio. Lighter ions get deflected more than the heavier ions. This is due to Newton's second law of motion. The acceleration of a particle is inversely proportional to its mass. Therefore, the magnetic field deflects the lighter ions more than it does the heavier ions. The detector measures the deflection of each resulting ion beam. From this measurement, the mass-to-charge ratios of all the ions produced in the source can be determined. From this information, the chemical composition of the original sample (i.e. that both sodium and chlorine are present in the sample) and the isotopic compositions of its constituents (i.e. whether the ratio of 35Cl to 37Cl has been changed by some process) can de determined.
This example was of a sector instrument, however there are many types of mass spectrometers. All of these have in common that they possess an Ion Source, that produces ions, an Analyzer that sorts them in some way by their masses, and a Detector that measures the relative intensities of different masses. The underlying principle of all mass spectrometers is that the paths of gas phase ions in electric and magnetic fields are dependent on their mass-to-charge ratios which is used by the analyzer to distinguish the ions from one another.