You are Here:
The Moon is surrounded by a soup of plasma consisting of negative electrons and positive ions. The total number of electrons and ions is the same, but electrons are lighter and faster, so there is a higher rate of electrons hitting the surface. The surface in shadow therefore charges negative as the electrons stick to the surface. In sunlight, on the other hand, solar photons eject electrons from the surface via the photoelectric effect (the effect that Einstein won his Nobel prize for!). These photoelectrons leave the surface at a faster rate than plasma electrons stick to the surface, leaving the surface with a positive charge. Both of these charging processes are self-limiting, because if the surface acquires too large of a charge it starts to attract or repel more charged particles to balance that charge.
The Moon does not have a global magnetic field like the Earth's that is generated by a dynamo inside the planet, though it once may have. However, it does have little patches of magnetized crust. No one knows how these Moon rocks were magnetized, thought it appears very likely that huge impacts had something to do with it. The big unknown is whether the Moon ever had a molten core and a dynamo that was capable of generating its own magnetic field. Whatever the case, it appears that these little patches of magnetization may be capable of creating perhaps the smallest magnetospheres in the solar system and shielding little regions of the surface from the bombardment of the solar wind. These regions are marked by curious "swirl" patterns that are observable when looking at the reflectivity of the surface, and may be a result of this shielding.
Yes, the Moon does have an atmosphere, but it is extraordinarily thin. In fact, it is called an exosphere, because most of the neutral gas particles in the exosphere spend their whole life without colliding with another neutral atom. Instead, they hit the surface, get hit by a photon or a charged particle and turned into an ion, or escape from the exosphere by other processes. Interestingly, the Moon can be thought of as having many separate atmospheres, because each kind of gas is so thinly dispersed that it does not interact with the other gases, and behaves only according to its own properties.