In addition to the intrinsic variability of the solar output, there exist a variety of ways in which the stability of the Earth's environment can be affected by the cosmos. The change with time of the shape and orientation of the Earth's orbit and precession of the rotational axis of the Earth caused by the gravitational forces from other members of the Solar System induce predictable variations in the terrestrial climate which can be seen in the geologic record. Encounters of the Solar System with dense interstellar gas clouds can also exert considerable influences on the terrestrial environment as can the occasional nearby explosion of supernovae. However, the most dramatic and, perhaps, the most likely hazards presented to the Earth by the cosmos are from the occasional collisions with substantial asteroids or comets. The energy delivered to the Earth in such an event would be equivalent to 10,000 times the total nuclear weapons stockpile of all nations. Such an event would have, and is thought to have had, enormous consequences for the stability of the biosphere.