“Cosmic rays are typically protons or atomic nuclei of elements such as helium, carbon, or iron. The most energetic have energies more than 10 million times greater than those in the world’s most powerful atom smasher, the Large Hadron Collider. Physicists aren't sure what astrophysical process could accelerate particles to such energies. Possible culprits include the lingering remains of supernovae, the explosions that occur when massive stars run out of fuel and die; and active galactic nuclei, superheated galaxies with supermassive black holes at their centers that spew out energy at prodigious rates.” Source: Science, 2016
The cosmic source of the (misnamed) 'rays' has been disputed since their discovery in 1912. Over the last hundred years or so, various sources have been suggested, including supernovas, quasars and (the as-yet-unknown source of).
Supernovae are again the main contender.
“In 2009, supernovae were said to have been “pinned down” as a source of cosmic rays, a discovery made by a group using data from the Very Large Telescope. This analysis, however, was disputed in 2011 with data from PAMELA, which revealed that “spectral shapes of [hydrogen and helium nuclei] are different and cannot be described well by a single power law”, suggesting a more complex process of cosmic ray formation. In February 2013, though, research analyzing data from Fermi revealed through an observation of neutral pion decay that supernovae were indeed a source of cosmic rays, with each explosion producing roughly 3 × 1042 – 3 × 1043 J of cosmic rays”
Nevertheless, Cosmic Rays are also known to be generated outside supernovae - but currently, the percentage is unknown.