(AP) ‘ So how exactly are gas prices set? What determines the hair-pulling figure you see displayed in large electronic or plastic numbers? Why is a gallon of gas, say, $4.11 ‘ not $4.10 or $4.12? Why is the price different across the street? It all starts with oil. The biggest factor in the skyrocketing price of gasoline is the historic ascent of crude oil, which has surged from $45 per barrel in 2004 to more than $135 this past week, setting new record highs all the while. In the first quarter of this year, based on a retail price of gas that now seems like a steal ‘ $3.11 a gallon ‘ crude oil accounted for all but about a dollar, or 70 percent, of the cost, according to the federal government. The rest is a complex mix of factors, from the cost of turning oil into gas to taxes to marketing costs to, sometimes, nothing more than the competitive whims of your local gas station owner. Not that understanding the breakdown makes it any less cringe-inducing to fill ‘er up. First a primer on how gas gets to your tank: Once oil is pumped from the ground, it can be sold on the spot market, a last-minute trading arena where oil companies and distributors buy and sell to each other, or straight to refiners. After it’s brewed into gasoline, the product can again be sold on the spot market, or directly to wholesalers, who in turn can supply their own stations or sell it to other retailers. Each step of the way, buyers and sellers negotiate a price until, finally, drivers pay the ultimate tab at the pump. At the starting point of all this is the price of oil ‘ which, like the oil itself, is nothing if not crude. The knee-jerk villains are the oil companies, fat with multibillion-dollar profits, frequent targets of populist anger. But wait: The oil companies don’t set the price of oil or the cost of a gallon of gas. Prices are a function of the open market, the result of futures contracts being traded on the New York Mercantile Exchange, or Nymex, and other exchanges around the world. Buying the current July crude oil futures contract means you’re buying oil that will be delivered by the end of July. But most investors who trade futures have no intention of ever accepting the underlying oil: Like stock investors who frequently buy and sell their holdings, they’re simply betting that prices will rise or fall. Of late, on the Nymex, oil futures have been rising. Why? Blame the falling dollar. Oil is priced in U.S. dollars, and the weaker the dollar gets, the more attractive dollar-denominated oil contracts are to investors. The rush of buyers keeps pushing oil futures to a series of new records, and the rest of the energy complex, including gasoline futures, has followed. That pushes up the price of gas that goes into your tank. “Crude is the driver,” said Jim Ritterbusch, president of energy consultancy Ritterbusch and Associates in Galena, Ill. “As long as it stays up there, gasoline’s not going to be able to decline much at all, even if demand slips. That’s just the way it is.” There is some evidence Americans are buying less gas as the price marches higher, and common sense suggests they would cut back even more if gas rose to $4.50 or $5 a gallon. Lower demand should mean lower prices ‘ but it takes time for that to happen, given the enormous scale of refining operations that produce gasoline. Oil and gasoline prices often move in the same direction, but they aren’t linked directly. In fact, while oil prices have more than doubled in the past year, gasoline is only up about 19 percent during the same time. For example, oil prices rose $2.46 in one day last month amid reports a ship under contract to the Defense Department fired warning shots at two boats in the Persian Gulf that may have been Iranian. A Navy spokesman later said the origin of the boats was unclear, but the news raised concerns that a conflict between U.S. and Iranian forces could cut oil supplies from the region. That same day, gas prices rose another 2.1 cents to a then-record national average of $3.577 a gallon on other supply concerns. And the rise has only grown more dramatic. Oil sprinted higher this past week, rising more than $4 a barrel on Wednesday alone and past $135 on Thursday. As for gasoline prices: They’re closely tied to demand from U.S. drivers and how efficiently refineries are operating. Falling production or inventories often send prices skyrocketing. Those prices can vary greatly depending on the region. Oil companies may not set the price of oil and gasoline, but not everyone is willing to sit back and let them claim to be innocent bystanders. In particular, for the second time this year, Big Oil’s biggest executives were on Capitol Hill in recent days getting pummeled by many in Congress for their record profits.