Gamma rays have the highest energy in the electromagnetic spectrum. They are produced by nuclear processes and have the shortest wavelengths. While X-rays are also high-energy, gamma rays are even more energetic. Cosmic rays are primarily high-energy protons, not electromagnetic radiation. Beta rays are electrons, not electromagnetic waves.