Both gamma rays and x-rays are photons with very high energies . The only difference is the frequency and hence the energy of the photons . Gamma rays are generally the most energetic of these , although broad overlap with X-ray energies occurs .