On the periphery of the Solar System lurk thousands of objects comparable in size to an exoplanet — a body of planetary mass not bound to our star. Their orbits are chaotic, and from time to time the trajectory of such a wanderer crosses Earth's path. A direct collision is not the only threat: even a close flyby can trigger a catastrophe on a planetary scale.
The geological record preserves traces of such events: in sedimentary rocks worldwide, synchronous layers of volcanic ash and mass faunal burials are found — evidence of instantaneous (in the geological sense) catastrophes. The hypothesis about the demise of the dinosaurs 66 million years ago allows that the trigger for the extinction could have been not only an asteroid impact but also the gravitational influence of a passing planet. And the Sun itself, over billions of years of existence, has more than once captured such wanderers into its gravitational well; their accretion temporarily intensified thermonuclear burning, and Earth alternately plunged into ice ages or experienced scorching heat.
Tidal forces knead Io, Jupiter's moon, so that it erupts lava without stopping — like a cosmic poker stirring coals.
In Stephen Baxter's novel Evolution, a passing neutron star changes Earth's climate and causes a mass extinction.