Gas prices have soared this year, making 2012 the most expensive year ever for gas nationally, according to a press release by Gasbuddy.

The national average was $3.63 per gallon. Some of the spikes were due to California's supply problem and also the impact of Hurricane Sandy flooding which caused power outages to refineries in the Northeast, said Gregg Laskoski, GasBuddy analyst, in the press release.

"It reminds us exactly how vulnerable our nation's fuel infrastructure is and why the U.S. should be looking to increase refining capacity where it is needed most," he said in the press release.

Patrick DeHaan, senior petroleum analyst for GasBuddy, did the math to see what it would take for the remainder of the year to drop the average below last year's mark. "The national average price of gasoline in the U.S. would have to drop to $2.35 per gallon or lower for every day for the remainder of 2012 in order for the 2012 yearly average to fall below last year's level."

Email: Twitter: @erinhong