What happens to a star when it’s hit by a massive blast of EM energy, like from a nearby gamma-ray burst?
It doesn’t even notice.
It just gets bigger and stronger and angry ?
You wouldn’t like it when it’s angry.
It gets a sunburn!
Taking the question a bit more seriously before the equations come storming in, we need a lot of focusing to attempt any answer.
First, we don’t know yet what causes gamma-ray bursts. Their light curves don’t resemble each other very much. And they all come from billions of light years away, making it tough to see sources, although some evidence is that they appear in fairly empty sectors.
One possible source is a supernova. If that’s true then nearby stars will be greatly affected, although probably not by the gamma rays specifically. Those are emitted in rays so a star has to be unlucky to get in the direct path. Any planet hit would have its life wiped out. The star itself could be disrupted.
Could a GMB have happened close enough to earth at some point to affect us? Some people think so.
Sounds extremely speculative to me, but IANAS.
Actually, we think we have a pretty good handle on the cause of GRBs, now. Or rather, the causes. There are two main types, and it’s now believed that they come from different origins. The so-called long duration gamma ray bursts, which can have faint echoes for several minutes after the main event, are now believed to be from extraordinarily powerful supernovae. The short duration bursts, meanwhile, which cut off abruptly and completely after a few seconds, are believed to be from a collision of two neutron stars to form a black hole.