How MRI Works: Atoms
The human body is made up of untold billions of atoms, the fundamental building blocks of all matter. The nucleus of an atom spins, or precesses, on an axis. You can think of the nucleus of an atom as a top spinning somewhere off its vertical axis.

Photo courtesy NASA
MRI Machine
The MRI machine applies an RF (radio frequency) pulse that is specific only to hydrogen. The system directs the pulse toward the area of the body we want to examine. The pulse causes the protons in that area to absorb the energy required to make them spin, or precess, in a different direction. This is the "resonance" part of MRI. The RF pulse forces them (only the one or two extra unmatched protons per million) to spin at a particular frequency, in a particular direction. The specific frequency of resonance is called the Larmour frequency and is calculated based on the particular tissue being imaged and the strength of the main magnetic field.
These RF pulses are usually applied through a coil. MRI machines come with many different coils designed for different parts of the body: knees, shoulders, wrists, heads, necks and so on. These coils usually conform to the contour of the body part being imaged, or at least reside very close to it during the exam. At approximately the same time, the three gradient magnets jump into the act. They are arranged in such a manner inside the main magnet that when they are turned on and off very rapidly in a specific manner, they alter the main magnetic field on a very local level. What this means is that we can pick exactly which area we want a picture of. In MRI we speak of "slices." Think of a loaf of bread with slices as thin as a few millimeters -- the slices in MRI are that precise. We can "slice" any part of the body in any direction, giving us a huge advantage over any other imaging modality. That also means that you don't have to move for the machine to get an image from a different direction -- the machine can manipulate everything with the gradient magnets.
When the RF pulse is turned off, the hydrogen protons begin to slowly (relatively speaking) return to their natural alignment within the magnetic field and release their excess stored energy. When they do this, they give off a signal that the coil now picks up and sends to the computer system. What the system receives is mathematical data that is converted, through the use of a Fourier transform, into a picture that we can put on film. That is the "imaging" part of MRI.
So how is this image converted into a picture that reveals the specific details we're looking for?