Cosmic rays rain down on the Earth every day. Most of them don't have that much of an effect, but some cause a chain reaction that makes an "air shower," raining billions of particles down onto the ground.
When a cosmic ray hits the atmosphere it is going to make a few changes, but usually just a few. For all its energy, a cosmic ray is tiny. It might, for example, hit the nucleus of a gas particle in the air, and the collision may create a varied bunch of hadrons.
Hadrons are a big family of particles, including protons and neutrons, and also including pions. Pions are made of a quark and an anti-quark, and are usually short-lived. These short-lived particles decay and form photons energetic enough to be termed gamma rays. The process slowly loses energy, in the sense of each new particle having slightly less energy than its progenitors. And not all the hadrons and gamma rays will interact with the atmosphere in productive ways; the majority of the time, the energy from an incoming cosmic ray disperses like a concentrated puff of wind disperses as it travels, and there's no real effect by the time we get to ground level.
But sometimes it's not that simple. Sometimes the hadrons made by the initial collision have a positive or negative charge. These are longer-lived particles, which may strike another gas nucleus as they fall. Sometimes the original gas nucleus, or the cosmic ray, or both, hit other gas nuclei and create their own burst of hadrons.
Sometimes the high-energy photons which are formed when the pions decay, interact with another nucleus, and the interaction produces an electron and a positron. Both the electron and the positron produced by this interaction can create photons. They are charged, and so when they pass another charged particle, their path changes. An electron passing by a positively-charged nucleus, for example, may bend its path toward the nucleus. This change in direction slightly decreases its energy, and it loses that energy in the form of a photon. A traveling electron may create a lot of photons through this process.
Sometimes the colliding, the creating, the decaying, the swerving, and the splitting result in a cascade of particles and photons known as an air shower. Air showers can be small, or they can rain down billions of particles of all types on the ground. Because the precipitation of particles starts, grows, reaches its peak, and then declines, the largest showers of particles usually are detected in the mountains, high up, before all that energy is lost. Still, the sudden burst of particles and waves is pretty impressive, and all because a cosmic ray unleashed the potential of our own atmosphere.