The Scottish Fire and Rescue Service (SFRS) has condemned the behaviour of those responsible as “completely unacceptable”.
Firefighters had been called out to a fire in a woodland area in Fauldhouse, West Lothian, on Monday evening when the attack took place.
With the group of youths throwing bricks and bottles at them, they had to withdraw from the scene while they waited for Police Scotland.
Ladies Day at Musselburgh Races: Children's nurse crowned most stylish woman
Edinburgh dad Joseph Wakeley dies days after being hit by car near Sheriffhall Roundabout
Livingston crash: 28-year-old woman pronounced dead at scene as man arrested in connection with incident
Pedestrian dies after being hit by car in Edinburgh
Edinburgh crime: councillor Kevin Lang left shaken after being ‘grabbed by throat’ while delivering newsletters
After officers arrived, the fire service were able to extinguish the flames.
None of the crew were injured in the incident.
SFRS group commander, Steven Michie, said: “I would like to stress that this behaviour – by a very small minority of individuals – is completely unacceptable and will not be tolerated.
“Wherever possible we will identify those responsible and pass that information to our police partners.”
He added that being involved in attacks on firefighters “can have serious consequences for those involved” and can “even affect future employment prospects due to having a criminal record”.
He continued: “Fortunately, there were no injuries to firefighters or damage to the fire engine in attendance at this incident.
“But this type of behaviour cannot be condoned, and we would urge the majority of law-abiding residents to alert the police to any such reckless activity.”
Last month, an officer from Wester Hailes Police Station criticised a group of youths who threw stones at a fire crew in Sighthill Park, Edinburgh.