No matter how many shooting stars you’ve seen, every one remains magical. A quick streak of brilliant light racing across the sky, a lingering shimmer trailing behind, and a silent wish for a hidden hope or aspiration. These experiences are what makes the annual Perseid meteor shower so special.

But have you ever wondered what a meteor is, or where their colors come from? The science behind it is mind-boggling. It is based on two primary details about the meteor, with elemental makeup often being key.

While it may seem like shooting stars are enormous, they’re actually quite small — many are only about as large as a grain of rice. Meteors come from a spattering of debris left in the wake of comets. For the Perseids, the instigating comet is Swift-Tuttle, which last passed Earth in 1992.

These itty-bitty interstellar chunks burn up in Earth’s outer atmosphere. That happens when our planet plows through the comet’s trail of remnant space rocks during the annual revolution around the sun. In space, there’s nothing to slow down these celestial pebbles. But when they encounter air drag at the edge of the mesosphere — 50 miles up — that friction generates heat that lights the space fragment ablaze.

The color of a meteor is dependent on two main factors: its elemental composition and its speed.

The flame’s hue depends on the metals within the meteor. While the Perseids are known for being neon green, purple, pink, orange and white, the December Geminids are tones of azure, turquoise and emerald.

The Perseids’ colors have been traced to calcium, sodium, magnesium, silicon and iron. Most of these elements can be found in your morning breakfast cereal. But that doesn’t mean dumping a bowl of Fruit Loops out your second-floor window is going to create quite as stunning a display. Speed is also a determinant. After all, the Perseids whiz by at 37 miles per second.

The faster a meteor travels, the more it compresses a cushion of air out ahead of it and the more that air heats up. Eventually, that pillow of air becomes so hot it starts to glow. This is thanks to a process known as ionization. When ionization happens, gas molecules can gain electrons. When electrons are lost, they emit a photon — a packet of light. The greater the energy contained within that packet, the more intense that burst of light.

This is the same general premise behind a neon sign. The fastest shooting stars can get the air glowing soothing shades of violet. Sometimes, it takes a few seconds for the gas to cool down enough to stop emitting photons — so a luminous path behind the meteor remains.

Vaporized dust and burned particulates from a meteor’s combustion can sometimes become swept up in the polar vortex that we know so well in winter here on Earth. This smoke can form “noctilucent clouds” near the poles when they interact with supercooled water droplets.

This year’s show will be at its peak between Saturday and Monday. The best show is likely to be in Monday’s predawn hours.

Between 50 and 75 shooting stars every hour should be visible after dark. There’s not necessarily a specific place in the sky to look, something covered in depth Wednesday. Bring a pillow or a blanket, sit back, relax and enjoy the show.