  The calculations in Thomas-Fermi approximation show that in a gravitational
field each cell of ultra dense matter inside celestial bodies obtains a very
small positive electric charge. A celestial body is electrically neutral as a
whole, because the negative electric charge exists at its surface. The positive
volume charge is very small, on the order of magnitude it equals to 10^{-18}e
per atom only. But it is sufficient to explain the occurrence of magnetic
fields of the celestial bodies and the existence of a discrete spectrum of
steady-state values of masses of planets, stars, and pulsars.
