Gamma rays are produced by nuclear processes in radioactive substances, specifically from the nucleus during radioactive decay or nuclear reactions. Infrared and ultraviolet rays come from electronic transitions in atoms. Microwaves are generated by electronic devices, not nuclear processes.