On the outskirts of the Solar System, thousands of objects the size of a planet lurk. Sometimes their paths cross Earth's orbit. A collision isn't necessary — even a close flyby of such a behemoth can trigger a catastrophe.
Such events left traces in the rocks: layers of ash and washed-away animals across the globe. The demise of the dinosaurs 66 million years ago might have been caused not only by an asteroid but also by a passing planet. And the Sun itself, over its long life, has snagged such wanderers, briefly intensifying its heat — Earth alternately froze and roasted.
Tidal forces knead Io, Jupiter's moon, so relentlessly that it erupts lava nonstop, like a cosmic poker stoking the coals.
In Stephen Baxter's novel "Evolution", a passing neutron star alters Earth's climate and triggers an extinction.