Actually LPC n00b, the price of gas is based on the wholesale price the station or chain paid for the last tanker load. The wholesaler bases his price on what he's paying the refiner - on contracts usually bought about 3 months ago based on the crude oil price at that time.

! The oil industry, from wellhead to gas station uses FIFO -
First
In,
First
Out - accounting to set prices. That means there is a ripple of delays as the latest tanker - ship or truck - and pumped batch reaches each stage of refining and delivery to retail stations.
What
CapnSteve calls "speculation" is actually commodity contracts based on experts' expectations/calculations of production volume and transportation costs (including safety). A source who speculates that they can get $0.10 or $0.20 per barrel more than other sources could find themselves stuck with a whole lot of oil they cannot sell.
Not that facts matter on DU.