When a single energetic cosmic ray hits the Earth, it typically interacts high in Earth's atmosphere, undergoing a particle physics reaction with an atom of air, shattering the atom. The outgoing shards of the atom are often energetic enough to in turn shatter additional atoms, and so on.
In this way, a shower of energetic subatomic particles develops. A small fraction of the particles in this shower can reach ground level and collide with atoms there. These secondary subatomic particles, produced as part of the shower in Earth's atmosphere, are sometimes grouped together with the ones that arrive at Earth directly from astrophysical sources and together called cosmic rays.