https://en.wikipedia.org/wiki/Gamma-ray_burst wrote:
<<
Gamma-ray bursts (GRBs) are believed to consist of a narrow beam of intense radiation released
during a supernova or hypernova as a rapidly rotating, high-mass star collapses to form a neutron star, quark star, or black hole. 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. 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.
Depending on its distance from Earth, a GRB and its ultraviolet radiation could damage even the most radiation resistant organism known, the bacterium Deinococcus radiodurans. Life surviving an initial onslaught, including those located on the side of the earth facing away from the burst, would have to contend with the potentially lethal after-effect of the depletion of the atmosphere's protective ozone layer by the burst.
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.>>