Technically, gamma rays are produced by a small proton accelerator. The beam of protons accelerated to the adequate energy collides with a target containing carbon-13 nuclei. In the collision, nitrogen (N-14) nuclei are formed in an excited state that return to ground state by emitting gamma rays.