An interesting point is that Mars has only a marginal magnetic field, mostly in the southern hemisphere. It is speculated that any previous atmosphere on Mars may just have been blown away by the solar wind as the planet's interior cooled. The atmosphere on Mars today is extremely thin, and more of it is constantly being ripped away.
Mars did have a more substantial magnetic field billions of years ago. This is shown by the polarity of iron in very old rocks. Thus, Mars may once have had a much denser atmosphere, too.
What creates a magnetic field in the first place? It is believed that Mars has no molten interior. On Earth, the molten interior and a solid iron core makes the planet somewhat like a spinning dynamo, which in theory creates the magnetic fields.
Here is a page from NASA about the magnetic fields on Mars:
http://science.nasa.gov/headlines/y2001/ast31jan_1.htm
Tormod