The Universe was born in the Big Bang and almost instantly passed through a phase of inflation — an ultra-fast expansion that blew up microscopic regions to cosmological scales.
Cosmic rays aren't rays in the usual sense: they're fast particles bombarding Earth from all directions. Mostly they're protons and atomic nuclei. Their energies vary widely, from modest to fantastically huge. When such a particle heads our way and the Moon or Sun gets in its path, it gets absorbed.