A phenomenological theory, based on a relativistically covariant generalization of Maxwell's equations to include gravitational fields, is developed to account for the magnetic fields of massive rotating bodies. The equations yield the Wilson–Blackett expression for the magnetic moment of the earth and stars but give no magnetic field for mass-bodies moving without rotation in their own gravitational fields. They indicate that the magnetic field due to the motion of the earth in its orbit is negligibly small compared to the field due to its rotational motion, and they provide a possible explanation for the variable magnetic fields of light-variable stars.