From Bill Brysons *a short history of nearly everything. Page 219
"The outer core (of Earth) is in many ways even less well understood, though everyone is in agreement that it is fluid and that it is the seat of magnetism. The theory was put forward by E.C. Bullard of Cambridge University in 1949 that this fluid part of the Earth's core revolves in a way that makes it, in effect, an electrical motor, creating the Earths magnetic field. The assumption is that the convecting fluids in the Earth act somehow like the currents in wires. Exactly what happens isn't known, but it is felt pretty certain that is is connected with the core spinning and with its being liquid. Bodies that don't have a liquid core - the Moon and Mars, for instance - don't have magnetism."
Great book that is slowly turning me into more and more of a geek, page by page. I highly recommend reading it. Under good lighting, without breaking the spine.