MRI, or Magnetic Resonance Imaging, is based on the same principles as NMR (Nuclear Magnetic Resonance) (they changed the name out of concern that patients wouldn't come near something 'nuclear'). Hydrogen atoms have a very small magnetic moment. Normally, these magnetic moments are completely random and cancel out. When placed in a strong external magnetic field, these hydrogen nuclei align either with or against the external field. When these are pulsed with radio wave energy, the tiny atomic magnetic moments flip from low energy state, to high energy state, and then relax back to the low energy state. Since the body is full of water molecules, mapping out the location and density of these molecules (or, more properly, the hydrogen atoms in the H2O), doctors can get a peek inside your skin.