All GRBs observed to date have occurred well outside the Milky Way galaxy and have been harmless to Earth. However, if a GRB were to occur within the Milky Way, and its emission were beamed straight towards Earth, the effects could be devastating for the planet. Currently, orbiting satellites detect on average approximately one GRB per day. The closest observed GRB as of March 2014 was GRB 980425, located 40Mpc (130 million light years) away in a (z=0.0085) SBc-type dwarf galaxy.
For a galaxy of approximately the same size as the Milky Way, the expected rate (for long-duration GRBs) is about one burst every 100,000 to 1,000,000 years. GRBs close enough to affect life in some way might occur once every five million years or so – around a thousand times since life on Earth began. The major Ordovician–Silurian extinction events of 450 million years ago may have been caused by a GRB.
The greatest danger is believed to come from Wolf–Rayet stars, regarded by astronomers as likely GRB candidates. When such stars transition to supernovae, they may emit intense beams of gamma rays, and if Earth were to lie in the beam zone, devastating effects may occur. Gamma rays would not penetrate Earth's atmosphere to impact the surface directly, but they would chemically damage the stratosphere.
For example, if WR 104, at a distance of 8,000 light-years, were to hit Earth with a burst of 10 seconds duration, its gamma rays could deplete about 25 percent of the world's ozone layer. This would result in mass extinction, food chain depletion, and starvation. The side of Earth facing the GRB would receive potentially lethal radiation exposure, which can cause radiation sickness in the short term, and, in the long term, results in serious impacts to life due to ozone layer depletion.
Longer-term, gamma ray energy may cause chemical reactions involving oxygen and nitrogen molecules which may create nitrogen oxide then nitrogen dioxide gas, causing photochemical smog. The GRB may produce enough of the gas to cover the sky and darken it. Gas would prevent sunlight from reaching Earth's surface, producing a "cosmic winter" effect – a similar situation to an impact winter, but not caused by an impact. GRB-produced gas could also even further deplete the ozone layer.