Physics defines gamma rays by their source in the nucleus, not only by their energy
In physics, the difference between a gamma ray and an X-ray is where the photon comes from, not how much energy it has. A gamma ray comes from nuclear decay, while an X-ray originates outside the nucleus. Because their energy ranges overlap, a gamma ray and an X-ray can be the exact same photon.
Scientists measure photon energy in a unit called the electronvolt (eV). One electronvolt is the small amount of kinetic energy one electron gains when it moves across a one-volt electric field. A photon of visible light has an energy of about 2 to 3 eV. X-rays and gamma rays have energies that are thousands or millions of times higher, measured in kiloelectronvolts (keV, or 1,000 eV) and megaelectronvolts (MeV, or 1,000,000 eV).
In the past, scientists separated X-rays and gamma rays by energy alone, because early X-ray machines could not reach the high energies of radioactive nuclei. Today, modern machines can accelerate electrons to create X-rays with many megaelectronvolts of energy. At the same time, some radioactive nuclei emit low-energy gamma rays of less than 10 keV.
Because these energy ranges overlap, physicists today classify the radiation by its origin:
1. X-rays come from electrons. An atom emits an X-ray when an outer electron drops into a lower energy level near the nucleus. Electrons also emit X-rays when they move at high speed and slow down sharply near an atom, a process called bremsstrahlung (German for "braking radiation").
2. Gamma rays come from nuclear and subatomic processes. A nucleus emits a gamma ray when its protons and neutrons drop to a lower energy state. Gamma rays also form when a particle and its antiparticle destroy each other, such as in electron–positron annihilation.
If a hospital machine slows down electrons to make a 1 MeV photon, that photon is an X-ray. If a radioactive nucleus decays and releases a 1 MeV photon, that photon is a gamma ray. Once the two photons are moving through space, they are identical in every way, and no physical test can tell them apart.
Previous: Gamma rays are the form of light with the highest energy and the shortest wavelengths
Fact-checked against Gamma ray on Wikipedia
Part of the Physics syllabus: Atoms and Nuclear Physics
See it on the timeline of Physics