Earth exchanges mass and energy with the rest of the solar system. It gains or loses energy through incoming solar radiation, thermal radiation to space, and gravitational forces exerted by the sun, moon, and planets. Earth gains mass from the impacts of meteoroids and comets and loses mass from the escape of gases into space.