Another idea is that when the gamma ray passes through any matter, it can give energy to that matter. What happens is dependent on the energy of the ray and what atoms or molecules are present. You probably guessed there would be variables, huh. Atoms can be ionized (the electrons are kicked out of their orbits), or chemical bonds broken by the ionizing radiation. This is a particularly nasty possibility that presents itself because of the extreme energy of the gamma ray. And covalent bonds, the low-energy kind of chemical bond that is so commonly present in living material, can take a beating from gamma rays. That's what makes them so dangerous. Eventually, the gamma ray scatters and loses enough energy to become something less penetrating and harmful. But some matter had to "pay the freight" on the scattering and energy reduction events. You'll find a link below for more information.