Click photo to enlarge
Gasoline prices higher than $5 per gallon are posted at a Menlo Park, Calif., Chevron station on Friday, Oct. 5, 2012. In California, gasoline prices jumped overnight by as much as 20 cents a gallon ending a week of soaring costs that saw some stations close and others charge record prices. (AP Photo/Noah Berger)

Gas prices soared as much as 20 cents a gallon Friday morning at some Bay Area stations, and the all-time record average of $4.61 could be shattered this weekend.

The rapid rise due to refinery problems across California led to lines of 50 cars at the Costco store on Automation Parkway in San Jose, filling up their tanks at $4.29 per gallon. When Costco opened its pumps Friday at 6 a.m., the price was $4.09. The store quickly raised the prices 20 cents.

By 9:15 a.m., people were spending nearly 20 minutes in line to fill up their tanks.

But down the road, a Chevron on Coleman Avenue was advertising a price of $4.58 for credit/debit card users. Only two or three cars were at that station.

The all-time single-day statewide high was reached in 2008, and "we most likely will exceed those highs," said Cynthia Harris of AAA. "By how much we don't know."

Gas was selling for $4.60 a gallon in San Francisco on Friday, just two pennies shy of that city's record.

San Jose stood at $4.54, three cents short of its all-time high, while Oakland was at $4.53, four cents below its record.

The average price of regular gas across the state was nearly $4.49 a gallon, the highest in the nation, according to AAA's Daily Fuel Gauge Report.

In many areas, prices have jumped 40 cents in a week as refinery problems have created shortages and helped send wholesale prices soaring. Some stations in Southern California ran out of gas and shut down Thursday rather than pay the extra costs.

Even Costco, the giant discount store chain that sells large volumes of gas, decided to close some stations, the Los Angeles Times reported.

The national average for gas is about $3.79 a gallon, the highest ever for this time of year. However, gas prices in many states have started decreasing, which is typical for October.

But in California, gasoline inventories are the lowest in more than 10 years -- a situation made worse by the state's strict pollution limits that require a special blend of cleaner-burning gasoline during hot summer months.

Contact Gary Richards at 408-920-5335.