The crew were forced to make a mayday call to the coastguard after the vessel's wheelhouse went up in flames south of Arran in the Firth of Clyde.
A Royal Navy search and rescue helicopter arrived at the scene 20 minutes later as the boat was engulfed in smoke and the team carried out a "difficult" rescue in poor visibility and rough sea conditions.
The two pilots had to hand over the controls to the aircraft's navigator, Lieutenant Commander Andy Drodge, who was able to manoeuvre it into position watching from the helicopter's cargo door.
With light fading, the men were preparing to abandon ship and take to their liferaft when the Royal Navy crew arrived.
Lieutenant Commander Drodge said: "We arrived on scene very quickly. Because the sea was quite rough, it made the rescue more difficult.
"Our winchman, Petty Officer Taff Ashman, was lowered on to the bow of the boat, where he was abseil to deploy a hi-line for us – this is a piece of rope which is attached to the winch wire, to pull it across to the boat, meaning the helicopter does not have to hover directly overhead, which can cause increased turbulence.
"Since the boat was rocking around and also bearing in mind we were trying to minimise blowing the smoke around, this was the best way to handle the situation.
"Once Taff was on the deck we elected to winch the crew members off two at a time, with Taff remaining on the burning boat to operate the hi-line.
"With all four sailors on board, Taff left our hi-line on the fishing boat and we positioned the helicopter above the deck to winch him clear."
The rescue was completed in just 22 minutes and all four sailors were recovered uninjured.