Summary, most likely no effect. At most, could have an effect on our ozone layer. The danger is from UV light. Our atmosphere shields us from the ionizing radiation, same mass as ten meters thickness of water.
Even if the burst originates as close as a few thousand light years away in our own galaxy, the only effects would be increased UV from an ozone hole, and though it might cause some extinctions (jury is out on that), it would be easy for humans to protect against. As for WR104, at one point they thought there was a chance that it was pointed at us. New data suggests that it is tilted away from us at an angle of 30° - 40° (possibly as much as 45°) which would mean it would miss.
IN DETAIL
DETAILS
First gamma ray bursts are rare. They come in two forms, the long bursts and the short bursts. Long bursts come from supernovae, but only 1% of them cause these bursts, so they are very rare. They are associated with the very most brightest of supernovae (hyperonva). Short bursts may come from colliding neutron stars. For details see The biggest explosions in the Universe. The beam is tightly focused in opposite directions so has to be beamed directly at us, so the chance of us seeing one that is focused on us is low. Typically the beam is focused to within a few degrees. For more details about them and the theory of how they are formed: Gamma Ray Bursts (GRBs)
We wouldn't be able to predict a gamma ray burst, as the gamma rays arrive at the speed of light from thousands of light years away, but the chance of it happening is tiny.
If it did happen, then it is a short lived event, from seconds up to hours at most (but the very long events are very unusual).
Gamma ray bursts are very focused, with beams in opposite directions, and would need to be pointed directly at us to cause harm - which is very unlikely. We have seen many gamma ray bursts in distant galaxies, but most are over a billion light years away, which shows how rare they are.
Short bursts are caused by colliding neutron stars. The beams they produce are so narrow that we only spot 0.4% of them. The bursts are so bright we can spot them billions of light years away and most of the ones spotted are over a billion light years away.Gamma ray bursts and pencil-thin jets
NASA gave a research announcement for a paper on How Deadly Would a Nearby Gamma Ray Burst Be? Paper itself is here. Some online sites reported this paper incorrectly as saying that the researchers had shown they were more hazardous than expected. Actually their conclusion was exactly the opposit eof that - they proved that they are less hazardous than expected.
This NASA image illustrates the effects of a gamma ray burst on the Earth’s atmosphere, artist’s impression. Only one side is affected because the burst is over by the time the other side of Earth comes into view.
Our atmosphere shields us from the worst effects. It’s equivalent to ten meters of water shielding us from cosmic radiation and gamma rays. So you don’t need to worry about direct effects of all that radiation - it just won’t reach us (same is true for a nearby supernova).
Most of the effect would be on the ozone layer creating a hole and leading to increase UV light until the hole heals. This increase in UV can then break up oxygen atoms at ground level and so cause increased ozone levels at ground level - so the effect is less in the upper atmosphere but more at ground level.
Shows how UV in the upper layer can cause Ozone smog at ground level
The next graph shows the output of their simulation. Altitude vertically, time in days horizontally. The red shows depletion of ozone in the upper atmosphere, and the blue shows increases of ozone in the lower atmosphere.
The gamma ray burst not only reduces the amount of ozone in the upper atmosphere. It also creates ozone depleting nitrogen oxides. They took the example of a gamma ray burst which hits the south pole most severely, as that has down drafts of air constantly. Those would bring the nitrogen oxides down to the lower atmosphere which is why you see the red regions descending with time. This causes a series of pulses of ozone depletion in the upper atmosphere which then leads to increases of ozone at sea level as the red regions let more UV through to the lower atmosphere. The model assumed a 100kJ/m2 burst from the direction of the South Pole, for a gamma ray burst within a few thousand light years of Earth (that’s very close compared to the diameter of the galaxy of 100,000 light years).
So could this raise the ozone levels enough to be harmful to life? The answer from this study was no. A very nearby gamma ray bursts could raise the ozone levels at ground level temporarily to 10 ppm. To be harmful to animal life it would need to reach 30 ppm. It is also not enough to be harmful to ocean life. Even if all the ozone created at ground level got absorbed in the sea, it would not be enough to be harmful to ocean life. So this disproves the hypothesis that a gamma ray burst could be the cause of the late Ordovician mass-extinction.
This was falsely reported on some news sites as proving that hypothesis that the gamma ray burst caused the late Ordovician mass-extinction. As you can see, that is the exact opposite of what they actually did prove..
However the paper was just about the effects of ozone. UV light remains a hazard after a gamma ray burst and could cause extinctions of species (not humans).
NEARBY GAMMA RAY BURST CANDIDATE
Are there any nearby stars that could go supernova and send a gamma ray burst towards us? Well there is this one WR104, which is about 7,500 light years from Earth. That makes it close enough for that 100 kJ type blast that could damage our ozone layers and it is a “Wolf Rayat star” which is likely to go supernova in the next few hundred thousand years.
Of all the stars of that type we know, it’s the only one that we seem to see more or less facing along its axis. So it could be pointed straight at us. The dust is lit up in a spiral pattern and it is carried around in synchrony with its companion star with a rotation period of 220 days.
More detailed picture here:
It looks as if it is facing us nearly face on. But spectroscopic observations of the star suggest it’s axis is at an angle of 30° - 40° (possibly as much as 45°) which would mean it would miss. See WR 104 Won't Kill Us After All - Universe Today
Though this sparked newspaper headlines about it killing us all, the thing to bear in mind is that even if we did get a direct hit, we’d be protected by our atmosphere and the effects would be on the ozone layer mainly and increasing UV until the ozone layer healed.
MORE ABOUT THE EFFECT OF A NEARBY GAMMA RAY BURST
Our atmosphere would shield us from most of it except some strong UV light due to depletion of the ozone layer. You'd be shielded from that just by standing in a shadow or shading yourself from the light any way you like. So, humans could shield against it easily, just use more sunblock when out of doors until the layer heals. Other creatures of course couldn’t use sunblock and might be more affected by it.
The oxides of nitrogen produced in the upper atmosphere are not concentrated enough to have an effect at ground level and this new research shows that ozone levels at ground level are not high enough to be hazardous even for a very close gamma ray burst. So the main effects are from the UV. So if a gamma ray burst causes extinctions then it would be due to the increased levels of UV light at ground level until the ozone hole heals. But this is something humans can protect ourselves against easily. More about its effects in this paper
Researchers reported in 2013 that Earth might have been hit by a Gamma-ray burst in 8th Century (paper: Effects of Gamma Ray Bursts in Earth’s Biosphere) but this would seem a bit unlikely considering how rare they are. Later research that same year (2013) found that the increased levels of Carbon 14 and Beryllium 10 in AD 775 could be explained by a solar flare instead, see The AD775 cosmic event revisited: the Sun is to blame
A nearby gamma ray burst, only a few thousand light years away, would hit one hemisphere of Earth with a short but intense blast of bright light, X-rays and gamma rays. But our atmosphere blocks these high energy photons, so much so that astronomers have to use space telescopes above the atmosphere to observe them.
Some of the UV light would get through the atmosphere, a brief fraction of a second burst of light, up to ten s of seconds for a long burst. But that seems unlikely to cause a biological catastrophe though some creatures would be affected.
Though the authors don’t say, human eyes are easily damaged by UV light so probably anyone looking at the flash at the time would be blinded, get a big dark spot form in their retina of dead cells, just as you would do if you stared at the sun through a telescope. But then - you might blink or shut your eyes automatically when you see such a bright flash of light, and UV light is blocked by the human eyelids, and if you are looking in a different direction or in a shadow from the burst you won’t be affected.
The main effects even of a very nearby gamma ray burst are
Of those, there isn’t enough nitric acid rain to harm organisms and the nitrate might actually act as a fertilizer for some plants.
The cooling is not that strong, reduction in 1% for some years. Unless the climate was close to some “tipping point” it’s not likely to have a significant effect.
The main effect is from ozone depletion. This would increase the amount of DNA damage from UV light up to sixteen times for a few months, and up to five to seven times the usual levels for several years.
Humans could easily protect ourselves. It’s only light and you could use barrier creams, broad rimmed hats, and clothes covering your skin etc for a few months or years to protect yourself from the UV until it returns to normal levels.
These effects seem too small to do much, so it’s a challenge to understand how even a nearby gamma ray burst just a few light years away could lead to mass extinctions. This is on going research. One idea is that perhaps there would be a knock on effect for instance, from impacts on phytoplankton. They account for half of CO2 fixation and oxygen production, so perhaps even a small effect on them could change the climate significantly. See Gamma-Ray Bursts as a Threat to Life on Earth
CONSPIRACY THEORY “PREDICTIONS” OF GAMMA RAY BURSTS
Sometimes conspiracy theory videos or websites claim that scientists have predicted a future gamma ray burst for some particular date that will devastate life on Earth. If you see something like this, you can be sure that they are an unreliable source for astronomy.
Most gamma ray bursts observed are over a billion light years away and we haven’t yet seen one in our galaxy. These bursts are very rare indeed so it is an unlikely scenario.
Also, they can’t be predicted as they are due to distant events which we can’t observe in enough detail to predict - and it doesn’t seem likely that we can predict supernovae or gamma ray bursts for precise dates in the near future. At the moment astronomers at best could say something like “this star may go supernova some time in the next few million years and if so there is a tiny chance it sends a gamma ray burst along its rotation axis” (most supernovae probably don’t produce gamma ray bursts at all).
PROBABILITY OF A GAMMA RAY BURST WITHIN 50 LIGHT YEARS (SAY)
The nearest likely gamma ray burst in the last billion years is 1000 parsecs away. But could we have a really close one, as close as say 50 light years away? Gamma ray bursts happen every 10,000 to a million years in a typical galaxy. The volume of the Milky Way, our galaxy, is roughly 8 trillion cubic light years and it has has 400 billion stars approx. (going by the higher estimates here).
The volume of space within, say, 50 light years is about 500,000 light years. So you’d expect it to contain 500,000 * 400 billion / (8 trillion) or around 25,000 stars.
Or for 20 light years, 33,510 cubic light years, then you get 33,510 * 400 billion / (8 trillion) = 1675 stars. We actually have probably around 150 celestial objects including white and brown dwarfs. Stars within 20 light-years. So that’s over estimating by an order of magnitude or so as we live far out in the thinner outskirts of the galaxy.
So anyway let’s overestimate throughout for a rough back of the envelope type calculation. So 25,000 stars out of 400 billion, and assume a gamma ray burst every 10,000 years and one in 100 of those (say) is pointed towards us. So that makes it a gamma ray burst pointed towards us and within 50 light years every (400 billion / 25,000) * 10,000 years, or every 160 billion years. Remember that this overestimates the number of stars near to us by an order of magnitude, so it’s probably more like once every trillion years or so. So such a nearby gamma ray burst seems very unlikely.
Even at 50 light years, we’d be protected from most of the damaging radiation by the thickness of our atmosphere. It’s equivalent in mass to a ten meter depth of water. It would be rather similar to a nearby supernova. It’s too unlikely to get much attention in papers on gamma ray bursts, but there are estimates of the effects for a supernova. See What’s a safe distance between us and an exploding star? And for more details, the paper here: Could a nearby supernova explosion have caused a mass extinction?
They find that a supernova within 32 light years (ten parsecs) would not heat up Earth significantly, would not be bright enough to harm the ecology through the light alone. In the year after the event so you’d get as much ionizing radiation as you get normally in between a decade and a century. So significant but it doesn’t seem to be enough to be devastating.
It seems likely to be similar for gamma ray bursts, so the main effects would be on the ozone layer and on nitric acid rain - but we don’t need to look into this any more I think as the event is so very improbable.
WHY DO MANY PEOPLE WHO ANSWER THIS QUESTION SAY THAT WE’D BE TOAST?
I think many of the stories that circulate just ignore the effect of the Earth’s atmosphere. It’s equivalent to ten meters of water which is enough to block out most radiation. Also they forget about how rare they are. Typically they will be thousands of light years away from Earth, happen only a few times in a galaxy and the galaxy is 100,000 light years in diameter.
So basically they do back of the envelope calculations rather than reading the scientific research papers on the subject. It’s understandable that they forget about our atmosphere so easily. It doesn’t feel as if it is so heavy. The pressure is equalized inside and out. A bit like the way fish swim in the sea, we breathe the air and have no idea how much weight of air there is above us because we have the same amount of pressure outwards too and are in equilibrium with it.
When you drink water with a straw what actually happens is that you create a reduced pressure at the top of the straw and the weight of the atmosphere pushes the water up the straw into your mouth. If you had a perfect vacuum then you could suck water up 10.3 meters. So the weight of the atmosphere is the same as the weight of 10.3 meters thickness of water. Every square meter of the Earth’s surface has 10.3 metric tons of atmosphere above it.
Here is a video showing how you can suck water up to several meters through a straw, six meters, but not quite 10.3 meters - because you can’t create a perfect vacuum. Anyway - at the end where it shows them trying to suck the water up to the top of a cliff - the atmosphere above us is equivalent in mass to a layer of water the height of that cliff.
That’s what they tend to forget.
So they are right, there’s no warning, but you aren’t toast. Indeed you’d not notice the event itself at all except as a very bright flash - good idea to close your eyes if that happens because the UV light could make you blind.
The effects of a nearby gamma ray burst or supernova, even if it is as close as just a few light years away would be just on the upper atmosphere on the ozone layer leading to more UV radiation - an ozone hole - and possibly nitric acid rain. The ionizing radiation effects are not significant.
SUMMARY
Perhaps Gamma ray bursts could have caused some mass extinctions in the past - but so far we don't have anything that is confirmed to have been caused by a gamma ray burst. It is a minority view hypothesis for the Ordovician–Silurian extinction events - if so this study suggests that they couldn’t have caused this extinction through ozone smog at ground level. That leaves the UV light but it’s hard to see that causing the extinctions to such an extent either. Paper about biological effects of gamma ray bursts here
You don’t need to worry that a gamma ray burst could make humans extinct. Though it could be a nuisance for us. Thankfully they are very very rare. Like supernovae, they can’t be predicted because they happen as a result of very distant astronomical events that we are nowhere near being able to observe with enough precision to predict such a thing.
We can identify stars that are going to go supernova in the next few million years, but that’s the most we can do by way of prediction. Of those only 1% would produce gamma ray bursts and of those, only a few typically would be beamed our way. So very very rare. The gamma ray bursts from colliding neutron stars are also very rare.
See also:
This originated in my answer to What would happen if a strong gamma ray burst were to hit the Earth? Any sort of technology that would withstand its effects? Would the burst affect the entire planet, or is there a chance parts of the planet would be affected to a lesser degree?
And this is from my Debunked: A gamma ray burst could make humans extinct
I’ve done a collection of many of my posts there as a book available to read online for free, also on Kindle
Doomsday Debunked (free online book - also available on kindle here: Doomsday Debunked (kindle) - all proceeds from the kindle edition go to international suicide prevention charities - at present to Befrienders International.