A quick-thinking doctor has risked his life to avert a potential disaster at a Melbourne service station, sparked by a senseless driver.

Hussei Zaini dashed to the rescue of a foolhardy motorist who set himself and his car on fire after playing with a lighter while filling up his tank with petrol at an ACPO station in Thomastown.

The incident, captured on CCTV video footage, shows the panicked motorist quickly escape the blaze as it engulfs the door of his vehicle.

Mr Zaini, who was filling up his car nearby, runs over to help put out the flames by throwing a bucket of water over the splashed petrol.

Meanwhile, a quick-thinking attendant shuts down the pump.

Station operator Suzy Eid, who was not working at the time but watched the drama unfold on video, told Seven News: "I thought it was common knowledge that nobody would light a flame next to a petrol pump while filling up. Why anyone would do something like that is just beyond me.

"He's not only endangered himself, but it was a danger to all of us. He could have done some severe damage."

Both Ms Eid and fire brigade officials have praised the bravery of Mr Zaini.

Melbourne Fire Brigade Deputy Chief Robert Taylor said: "I think he's had a fantastic presence of mind.

"He has recognised the danger of the situation...his bravery is to be commended."

Fire officials say the incident should serve as a lesson to us all as those involved were just seconds from a potential disaster.

They say the scenario would have been very different if more than a film of petrol had been spilled on the concrete because the doctor could have been engulfed.

"He's very lucky the Gods were on his side because it was a splash, anymore than that and it could have gone against him," Dep Chief Taylor added.