The solar system has a rather well-known history. Looking at the present situation, one might get the impression that it was a rather stable and well-defined system: the orbits of the planets appear to be stable, climate and atmospheres on the planets have been determined, the risk of collision with other bodies (comets, asteroids, meteorites) seems to be small. However it is known today that the evolution of life on Earth was neither a steady progression nor uniform. There were several periods of mass extinction. These catastrophic events played a crucial role in the rise of new species. Events of astrophysical origin include: Asteroid impacts - Major solar variability (space weather) - Nearby supernovae - The passage of the solar system through dense interstellar clouds. Catastrophic cosmic events of this type appear in the range of some 100 million years. The author discusses whether and how such events could have occurred in the solar system as well as in the recently found extrasolar planetary systems. In this text, which addresses readers in the field of Astrophysics and Astrobiology but also Geophysics and Biology these cosmic catastrophic events are described at an intermediate student's level.