The key point to recognise is that mass spectrometric measurements are carried out under vacuum conditions. In order to perform the analysis, the sample must somehow be turned into gaseous fragments.
Mass spectrometry of solids can most easily be achieved by bombarding the sample with energetic ions (e.g. Ar+). This causes the solid to emit so-called "secondary ions" (ionised fragments of the solid) which are then mass-analysed in a conventional mass spectrometer. This technique is known as secondary ion mass spectrometry or SIMS. SIMS is widespread in all kinds of applications, e.g. geology, semiconductors, and is known for its high sensitivity (<< 1 atomic layer).
Liquids are usually volatile enough to be analysed as gases (e.g. by allowing a small sample to expand in the ionization chamber). This is the approach used in gas chromatography (liquid is injected onto a hot filament, and vaporises). A technique related to SIMS, fast atom bombardment, is also used for mass spectral analysis (liquids of interest are mixed with the relatively involatile glycerine, for example).