Many drivers are giving more at the pump than a year ago, but they still have reason to be thankful. Prices in many parts of the country have fallen recently, and AAA says gas prices could end the year lower than where they started.

The national average Wednesday was $3.43, down 44 cents from mid-September although still 8 cents higher than a year earlier. Gas started the year at $3.28 a gallon. AAA says it should be between $3.10 and $3.30 when 2012 ends.

Still, because the price was so high for so much of the year, Americans are likely to spend a record amount for gas in 2012. Tom Kloza of the Oil Price Information Service estimates that Americans will spend about $483 billion on fuel this year, eclipsing last year's record of $471 billion. And that's even as Americans use less gas by taking shorter trips or driving more fuel efficient cars.

The Energy Department estimates that gas prices will average $3.64 a gallon this year after averaging a record $3.53 a gallon in 2011.

A number of things affect the price of gasoline. It starts with the price of oil, which can be affected by everything from the strength, or weakness, of the global economy to tensions in the Middle East. That oil is turned into gasoline and other products at refineries. The U.S. has about half the number of refineries it did 30 years ago. When one goes down due to a fire or unplanned maintenance, it can lead to a shortage of gasoline, which sends prices higher.

All of these factors have come into play in a big way this year. That's why prices haven't just been high -- they've been on a roller coaster. There have been four separate swings of at least 40 cents -- two higher and two lower.