The force pulling the Earth towards the Sun is about the same as a second force. This second force is called the centrifugal force. The centrifugal force exists because the Earth moves sideways. This sideways motion makes the distance between the Earth and Sun increase. Since the Earth is being pulled towards the sun and moving away at the same time, it stays at about the same distance. This is also how the Moon orbits the earth. In this second case, Earth is the ball and the Moon is the object. 