They can reach the Earth's atmosphere. But, they don't usually hit the Earth's surface because they interact with particles in the Earth's atmosphere.
Cosmic rays are mysterious.
Scientists are just beginning to understand exactly where they come from and why they have such high energy. Scienstists can see evidence of cosmic rays inside our solar system , in our galaxy and in other galaxies too. So, these cosmic rays are all over. Diffusive shock acceleration explains how galactic cosmic rays are formed. These are cosmic rays that come from outside of our solar system.