Fire Commissioner Joseph Finn said the blaze caused more than $1 million in damage to houses and a mixed-use building.
One firefighter was treated for a leg injury, but there were no other casualties. At one point, firefighters were ordered to leave the buildings because of a possible roof collapse.
Finn said the cause was believed to be an electrical problem.
Julie Picard, who lives in one of the buildings, said she was cooking when she saw flames coming from the house next door.
"I called the cops and started grabbing my stuff. It was busting out the windows and the aluminum siding was melting down," she told the Boston Herald. "There was nothing I could do about it, it was spreading so fast. There's only four feet between the buildings. I pray I have anything left."