A man has accidentally set his car on fire by using a cigarette lighter to see while filling his car with a jerry can in western Victoria.

The Sunshine man ran out of fuel about one kilometre east of Ararat on the Western Highway just after midnight on Sunday morning.

He went to a local petrol station on foot to get a jerry can but could not see what he was doing when he returned to the car.

Acting Inspector Brendan Broadbent said the man abandoned commonsense in the search for a solution.

"Because there was no light he's actually, in the process of pouring fuel into his vehicle, he's used his lighter to light up the area so he could see," he said.

"Subsequently the fumes have ignited and the vehicle's caught on fire."

The rear of the car was burnt but Acting Inspector Broadbent said the man was lucky to escape without injury.

"That could have been far worse."