The price of gas in Illinois fell in July, but that’s not the whole story.

The price in July was down eight cents from June, to a statewide average of $3.60, according to the monthly survey by the Triple-A Chicago Motor Club. But the price rose sharply late in the month, for two main reasons:

nThe drought has caused the price of corn to rise, and with it, the price of ethanol, a component of gasoline.

nProblems at refineries in Lemont and Whiting, Ind. have limited supply in recent weeks, making the wholesale price of gasoline higher.

Triple-A spokesman Nick Jarmusz says it goes to show that with gas prices, you never know. “The way gasoline prices are determined, or the factors that go into what you pay at the pump are so varied and complex that changes in any one of the areas can affect prices pretty significantly,” he said.

Jarmusz says the refinery problem will be temporary, but the price of ethanol will last indefinitely.