First, the average salary is $34,000 per year. And gasoline and other goods are not linked to salary and I wish for the love of god people would throw out that misconception. BUYING POWER is linked to salary and inflation. Prices are controlled by supply and demand and cost of goods. people mistakenly believe that if you artificially raise salary people have more buying power and instead they have more inflation. That's a whole other rant.
Second there are 42 gallons in an oil barrel. (i know most barrels come in 55 gallon variety, but not oil)
here's a rough breakdown
at present the price per gallon of crude is ~ 1.74 add to that the embedded taxes, not the end taxes but the taxes on the corporations (as you know corporations don't pay taxes they pass them along), ~42 cents it ends up being $2.15 add the cost of refining, transport and storage. then add the federal gas tax of about 18.4 cents and the state taxes which vary widely see http://api-ec.api.org/filelibrary/ACF13E.pdf
but here in pa is 32.3
and then the county gets in on it. and the 6-7 cents for the station owner and the credit card transaction fees. this is highly inefficient if you were to purchase 1 gallon at a time, but since you don't they make it in volume. Most of these costs are fixed and the only real variable is the raw price of crude. And if price gouging is to occur this is the spot where it would happen.
basically everyone has their hand in the pocket before it gets to the pump, and while supply and demand drives the final price it is the add-ons that are really driving the price, especially if you consider all the crazy laws which add a variety of blends during specific months of the year etc..
and while the price goes up it actually pushes demand out of fear, people are afraid it will go up again tomorrow so they top off today which actually pushes the price higher in a never ending cycle of insanity.
The part that bothers me the most is that we don't allow new refineries to be built (as if we haven't made any technological breakthroughs in the last 30 years) we don't allow drilling meanwhile cuba and mexico are drilling as little as 43 miles from our shore. (that's right OUR shore) we can't do it because of ecological impact but they can and will.