Adding to Oceanescence's mention of Gamma Ray Bursts, someone's recently done some calculations: Gamma Ray Bursts Limit The Habitability of Certain Galaxies, Says Study
In fact, according to the authors of the new paper, there is a 90% chance that a GRB powerful enough to destroy Earth’s ozone layer occurred in our stellar neighborhood some time in the last 5 billion years, and a 50% chance that such an event occurred within the last half billion years. These odds indicate a possible trigger for the second worst mass extinction in Earth’s history: the Ordovician Extinction. This great decimation occurred 440-450 million years ago and led to the death of more than 80% of all species.
Gamma ray bursts are thought to emerge from the poles of supernova, so a star's spin axis would have to be in the right direction for it to hit us. Betelgeuse, a nearby supernova candidate has it's spin axis at an inclination of about 20° to the direction of Earth, so that star is not likely to get us when she blows. However, we don't have accurate information on the direction of the spin axis of most stars.