First things first: cosmic rays are particles, consisting primarily of protons, electrons and alpha particles (helium nuclei), and not rays in the comic book science sense of the word. The particles enter the atmosphere individually, and not in any kind of coherent group.
From there, we can divide cosmic rays into two groups: primary and secondary. Primary cosmic rays are derived from some cosmic source, while secondary cosmic rays are created when primary cosmic rays strikes against interstellar matter, breaking it up into more cosmic rays, a process known as cosmic ray spallation.
Another subgroup of cosmic rays are the ultra-high-energy cosmic rays, which have energies either at the theoretic limit—or even higher. This particular puzzle is currently being teased out by physicists.