The bullet smashed the rear window and lodged in the woman's seat headrest.

The woman said she turned to tell her male occupant to "duck, he's got a gun" just before the shots flew towards them.

The pair told investigators the four wheel drive followed them from Dairy Road, Donvale onto the Maroondah Highway about 9pm on Sunday.

The Castella man, 44, was allegedly flashing his headlights on and off high beam as they travelled along Nicholson Street before firing the shots.

The pair phoned police as the man continued following them through Healesville's streets.

Police intercepted him in a car park, where he was arrested.

The man is being assessed in custody.