The immediate cause of the California price rise was a power failure at Exxon Mobil’s Torrance, Calif., refinery on Monday that shut down some production units at the 150,000-barrel-a-day facility. The company on Friday said the refinery had resumed normal operations. Supplies on the West Coast had already been tight because of an Aug. 6 fire at Chevron’s 245,000-barrel-a-day Richmond, Calif., refinery, which has still not been restored to full production.

California typically has substantially higher gasoline prices than most of the country because of its tough environmental regulations and high taxes. Gasoline supplies are traditionally tight this time of year as refiners do maintenance work to switch from summer to fall gasoline blends mandated by the California pollution-reduction regulations. But this year, energy experts say, the local gasoline market is particularly chaotic because of the refinery shutdowns.

Refining experts said the rationing and exceedingly high prices would probably last a couple of weeks at the most. Tom Kloza, chief oil analyst at the Oil Price Information Service, said California customers might get some relief in the next few days because traders were suddenly lowering the prices of their bulk sales almost as fast as they were raising them over the last few days. He said the wholesale price for gasoline on the West Coast dropped 50 cents on Friday from a high of $4.25 a gallon.

“The prices are incredibly erratic,” Mr. Kloza said. “It’s gone from incredibly excessive pricing to just plain excessive.”

In Southern California, Costco Wholesale outlets and other unbranded stations were particularly hard hit by the shortages because refineries normally supply their branded customers first because they pay a higher premium for locking in guaranteed supplies. Valero Energy, along with other refiners, temporarily halted spot sales of gasoline to some of its California customers.

Newsletter Sign Up Continue reading the main story Please verify you're not a robot by clicking the box. Invalid email address. Please re-enter. You must select a newsletter to subscribe to. Sign Up You will receive emails containing news content , updates and promotions from The New York Times. You may opt-out at any time. You agree to receive occasional updates and special offers for The New York Times's products and services. Thank you for subscribing. An error has occurred. Please try again later. View all New York Times newsletters.

“California requires a specific blend of gasoline that only the refineries on the West Coast make,” said Bill Day, a spokesman for Valero. “So when there is a shortage of that blend, you can’t just send supplies from somewhere else.”

Gasoline prices largely depend on the price of crude oil. Global oil prices have eased somewhat since the beginning of the year, despite turmoil in the Middle East and sanctions on Iran. The easing is attributed to slowing economic activity around the world and increased supplies coming from several countries including Iraq, Libya, Saudi Arabia and the United States.

Across the country, gas prices remain high. The $3.79 average price for a gallon of regular is 39 cents higher than it was a year ago, although the price has come down 3 cents over the last month.

Advertisement Continue reading the main story

Nationally, Mr. Kloza said, the price of a regular gallon of gasoline should ease to about $3.50 between now and December, which would put prices fairly similar to a year ago.

High gasoline prices have frequently been a political issue, but President Obama may get a break this year because several swing states like Florida, Ohio, Virginia, North Carolina, Nevada and New Hampshire have gasoline prices that are relatively low compared with the national average.

On Friday, in central Los Angeles, motorists expressed a combination of frustration, resignation and anger.

“I’m not happy about it,” said Michael Eisenhower, 52, a television costume designer, as he stared at the digits rising to nearly $40 to fill up his sport utility vehicle. He stopped short of topping off as he complained that his wages were not rising as fast as the price of gas.

“I’ve been putting in a reasonable amount of gas, enough for two days or so,” he said. “It’s my way of budgeting what I have to work with each week.”