Asteroids aren't the only things in space we have to worry about. A massive solar storm emitted from the sun could fry electronics and satellites around the globe, and take down much of the power grid. And such a storm isn't as far-fetched as you might think: according to readings taken from a satellite in earth's orbit, a solar superstorm passed through earth's path on July 23rd, 2012 — if it had struck nine days earlier, our planet would have been right in the crosshairs.

A 2009 report from the National Academy of Sciences said that such a storm could cause some $2.6 trillion in damage and a full recovery could take years. One researcher who studied data collected from the storm, professor Ying D. Liu of China’s State Key Laboratory of Space Weather, said that repairs could take two to four years. That's mainly because many of the massive transformers that make up the power grid would be taken offline by such a solar storm. Parts for those transformers are very difficult to come by.

Storm could have left 130 million without power

John Kappenmann, a co-author of the National Academy of Sciences' 2009 report, found that a large solar storm could leave 130 million in the dark. Without power, Kappenmann explains that "water distribution [would be] affected within several hours; perishable foods and medications lost in 12-24 hours; loss of heating/air conditioning, sewage disposal, phone service, fuel re-supply, and so on." In addition to damage to the power grid, a storm would shut down satellites and bring GPS and radio systems offline, at least temporarily.

The type of solar storm in question is known as a coronal mass ejection (CME), which occurs when an eruption on the sun shoots magnetized plasma clouds, X-rays, UV radiation, and protons and electrons out into space at extremely high speeds. CMEs are not rare, but the one that occurred on July 23rd, 2012, was particularly potent. Researchers from UC Berkeley concluded that the storm in question was in fact two separate CME events separated by 10 to 15 minutes.

Storm missed earth by nine days

The largest recorded CME to hit earth occurred in 1859; at the time, it sent sparks flying from telegraph wires and produced Northern Lights as far south as Hawaii and Cuba, according to reports. Researcher Daniel Baker from the University of Colorado said in a NASA article that "in my view the July 2012 storm was in all respects at least as strong as the 1859 Carrington event."

Despite the danger posed by such solar storms, the July 23rd event was not quite the "near miss" some news reports have painted it as. The earth was roughly a third of the way around its orbit from the location where the CME struck. Nevertheless, some researchers say that there is as much as a 12 percent chance that a storm the size of the 1859 strike will hit earth in the next decade. If we create better early warning systems, experts say, it may be possible to protect some sensitive electronics from a strike by shielding them or disconnecting them prior to a strike.