We build a model to describe the net charges existing in the Sun and Earth. According to statistical mechanics, electrons on average move much faster than protons and neutrons at the same temperature. Electrons escape the Sun more easily than protons and neutrons, so the Sun becomes a charged star. We estimate the maximal net charges in the Sun by using statistical mechanics first. Then, we analyze the dynamical cycles between the positive and negative charged states. At a distance far away from the Sun, the effective net charges including the leaving protons and electrons are about 6.3×109C with energies of 1 GeV initially. We also use another way based on the observations of the Earth's perihelion precession to estimate the minimum and maximum net charges between 1.15×108C and 2.80×1010C in space from the Sun to Earth. The most charged particles from the Sun to the Earth are electrons, so both the Moon and Earth are impacted by them and very possibly have the same electricity. Next, we propose new physical mechanisms causing the slowdown of the Earth's spin and propose Coulomb's repulsive force resulting in the increasing distance between the Moon and Earth. As a result, it gives the net charges of 1.11×106C surrounding the Earth and 8.29×103C surrounding the Moon. Our estimations also correspond to early works. The charges surrounding the Sun and Earth cause the Earth to be long-term accelerated in the radial direction by Coulomb's force. Finally, using the effective net charges of the Sun and Earth, we calculate the increasing distance between 11.4 m and 19.4 m on average per century if the initial radial velocities of the Earth are in between 3.59×10−9m/s and 6.12×10−9m/s, which satisfies the observed reports.