Mass spectrometry is a technique we use to analyse and determine the structure of compound. Generally, it works by injecting your compound into an ionisation chamber, where it breaks up into smaller fragment ions. These fragments then travel though a magnet (the analyser) which changes the path of the different ions depending on their size- smaller fragments are deflected more by the magnetic field (F=ma) than larger ones. The sorted fragments then pass through to the detector, where we are shown our mass spectrum. The largest fragment, M+, is the molecular ion, and usually is your compound minus a proton etc. Smaller fragments can give you information about the structure of a molecule, for example if there is a benzene ring in your compound, you might see a fragment with a mass of ~77. These fragments give you a characteristic relative abundance spectrum (specific to your compound).