After an evening filled with strong thunderstorms and heavy downpours, residents of Chicago were treated to the amazing sight of a double rainbow Wednesday evening as skies began to clear just before sunset.

It was a stunning scene, and there's a lot of science that goes into making these wonders.

(MORE: 5 Things a Hurricane Can Do That Are Actually Good )

How Rainbows Form

Double rainbows are the result of specific optical effects occurring simultaneously.

All rainbows require the presence of the sun and rain in order to form. The sun must be to the viewer's back, and rain must be falling ahead of the viewer. It doesn't necessarily have to be raining on or near the viewer, but rain must be present ahead of the viewer toward the horizon.

As the sun breaks through the clouds and shines toward the raindrops, some of the sunlight encounters the raindrops and bends in a process known as refraction . When the sunlight refracts, it separates into different wavelengths . These different wavelengths correspond to different colors: red and orange correspond to longer wavelengths, while blue and purple correspond to shorter wavelengths.

(MORE: Thunderstorm Activity Is Peaking in These Parts of the U.S. )

The refracted sunlight waves then bounce, or reflect , off the circular edges of raindrops and refract again as they exit the raindrops and travel through the air.

Because raindrops are relatively round when the sunlight refracts through them, the visual result is a spherical arc that stretches across the sky. Viewers who are lucky enough to see a whole rainbow will observe a colorful arc spanning the entire sky.

If rain happens on a fairly frequent basis, then why do rainbows remain a relatively rare event?

Rainbows can only occur when the refracted sunlight strikes a raindrop's edge at exactly 48 degrees. If the angle is less than 48 degrees, the sunlight will pass through the raindrop. Any angle greater than 48 degrees will cause the sunlight to reflect out of the raindrop, and no refraction will occur. Without refraction, a rainbow cannot form.

What's A Double Rainbow?

During a particularly lucky scenario, two rainbows will form at the same time. The first and brighter rainbow is called the primary rainbow. This rainbow is created by the process described above, and only requires the light to reflect off the raindrop once before refracting out of it.

The second, more faint rainbow is called the secondary rainbow. It occurs when refracted light does not escape the raindrop after being reflected the first time. Instead, the refracted light reflects off the raindrop's surface a second time as well , producing a secondary rainbow with its colors reversed. Fewer light rays are available to undergo the additional refraction process, so the resulting secondary rainbow appears less vivid.

Theoretically, triple and even quadruple rainbows are possible, depending on how many times refracted light is reflected within a rainbow. These additional rainbows are much rarer, since the concentration of light rays available for reflection and refraction decreases with each optical process. But if you spot one, be sure to share it with us on Twitter or our Facebook page .





MORE ON WEATHER.COM: Double Rainbows