From my rudimentary understanding, gasoline is sold on the open market like grains or beef or a hot stock. When something like the hurricane happens, panick sets in and prices artificially rocket. So who is pocketing this money? We know crude oil is about $70/bbl, and a barrel (42 gal) yields about 28 gal of gasoline. So that's less than $2.50/gal. Now, the refinery sells it on the market to distributors (I think they pay the wholesale/futures price, which is like $2.60/gal). The distributor, in turn, takes his cut and sells it to service stations, who mark it up around 1-2 cents/gal. Included are 40-60 cents fed/state taxes. So it seems to me, the refinery owner who is buying the crude at $70/bbl and selling gas at the panick prices is pocketing the bulk of the money.
Not only that, but the price of crude is for delivery in the future, so the gas today was crude bought at, say, $50/bbl a couple of months ago, yet the refinery is making today's prices on gasoline. It's like when the gov't lowers interest rates, and banks take weeks lowering their rates and pocket the profits. OTOH, when rates increase, banks increase their rates practically instantly.
Last, even when everything was going alright, US refining capacity was strained. There hasn't been a new refinery built in 30 yrs. Why? No one wants a refinery in his backyard, EPA regs are strict, and why would you want to lower prices by increasing the gasoline supply and have to spend all that money to build that new refinery if you were an oil/gasoline company? I'm sure I've just touched the tip of the iceberg, as the entire oil to gas system is pretty complex.