From NASA Science News:
Near Miss: The Solar Superstorm of July 2012
If an asteroid big enough to knock modern civilization back to the 18th century appeared out of deep space and buzzed the Earth-Moon system, the near-miss would be instant worldwide headline news.
Two years ago, Earth experienced a close shave just as perilous, but most newspapers didn't mention it. The "impactor" was an extreme solar storm, the most powerful in as much as 150+ years.
"If it had hit, we would still be picking up the pieces," says Daniel Baker of the University of Colorado.
Baker, along with colleagues from NASA and other universities, published a seminal study of the storm in the December 2013 issue of the journal Space Weather. Their paper, entitled "A major solar eruptive event in July 2012," describes how a powerful coronal mass ejection (CME) tore through Earth orbit on July 23, 2012. Fortunately Earth wasn't there. Instead, the storm cloud hit the STEREO-A spacecraft.
"I have come away from our recent studies more convinced than ever that Earth and its inhabitants were incredibly fortunate that the 2012 eruption happened when it did," says Baker. "If the eruption had occurred only one week earlier, Earth would have been in the line of fire.
These have happened before and hit Earth. They talk about the Carrington Event:
Before July 2012, when researchers talked about extreme solar storms their touchstone was the iconic Carrington Event of Sept. 1859, named after English astronomer Richard Carrington who actually saw the instigating flare with his own eyes. In the days that followed his observation, a series of powerful CMEs hit Earth head-on with a potency not felt before or since. Intense geomagnetic storms ignited Northern Lights as far south as Cuba and caused global telegraph lines to spark, setting fire to some telegraph offices and thus disabling the 'Victorian Internet."
If this happened today, we would be in for ten years of privation. Camping is fun but having to live without electricity, running water and communication for more than a month or so is something that 95% of the western population is unprepared for. Farmers and rural tribesmen will come out OK but people in urban areas, not so much. The article calculates the odds of this happening as 12% over the next ten years.