Mass spec is used alongside many analytical techniques, and provides information of the structural formula of a molecule such as proteins. Initially the sample is vapourised and then ionised by bombarding it with high energy electrons that essentially remove an electron off your sample forming a net +1 charge.This part can also cause fragmentation of the molecule.
Following the ions are then accelerated through an electric field and deflected (depending on their mass), by a magnetic field informer to reach. detector where their mass/charge ratio is given and plotted as a graph against intensity.