"It comes down to one goal," Rask said, "so it makes it even more heartbreaking."
Michael Ryder and P.K. Subban put Montreal ahead 2-0 early in the second period. Then the Bruins, who had scored only nine goals in their previous five games, scored four in just over 14 minutes against goalie Carey Price.
"It was nice to see us score some goals," Bruins coach Claude Julien said, "but, unfortunately, we couldn't keep (the puck) out of our net."
Rookie defenseman Dougie Hamilton started the comeback with his fourth goal at 3:32 of the second period, Marchand tied it, Bergeron put Boston ahead and Horton made it 4-2 at 17:36 of the period.
Price was replaced by Budaj to start the third period and he allowed just Seguin's 11th goal of the season at 11:50 of the third period that made it 5-3. Gallagher scored 28 seconds later, then Markov tied it on a power play.
With Aaron Johnson in the penalty box for delay of game, Markov's shot from the left point went off Chara's stick. Gallagher, also in front, initially was credited with the goal before an official scoring change gave it to Markov, his sixth.
"You can't blame your player," Julien said. "It hit the shaft of his stick."
Montreal's comeback ruined the Bruins' rally from a 2-0 deficit.
Ryder, a former Bruin, opened the scoring at 4:15 of the first period and Subban gave the Canadiens a 2-0 lead at 2:53 of the second.
Ryder cut the lead to 4-3 with his second goal of the game and 12th of the season at 3:58 of the third period on a 20-foot shot from the left after taking a cross-ice pass from Tomas Plekanec.
"In the third, we knew we had to change it up a bit and start getting back to our game," Ryder said, "getting pucks deep and skating. That's what we do best."
Seguin restored Boston's two-goal advantage, lifting a short backhander over Budaj's left arm off a pass from Marchand. Bergeron got his third assist of the game on the play. But the Bruins couldn't score again while the Canadiens rallied.
"We scored three goals in their building in the third," Budaj said. "That doesn't happen too often. It showed a lot of character."
Hamilton had started Boston's comeback from the 2-0 deficit with a 30-foot shot from the slot. Then Marchand scored his team-leading 14th goal when he rebounded his own shot off the wall behind the net and knocked the puck off the back of Price's left skate and into the net.
Marchand had an excellent opportunity when he broke in alone and fired a 20-footer from the right that Price deflected into the stands with his left glove at 13:55.
But Bergeron didn't miss three minutes later when he scored his 10th goal on a power play at 17:01. A shot hit Subban, the puck ricocheted to the left and Bergeron connected from 25 feet for a 3-2 lead.
The onslaught continued just 25 seconds later when Horton scored his ninth goal. David Krejci stole the puck on the left side at his own blue line, skated through the neutral zone and fed it across to Horton, who beat Price with a 15-foot shot.
The Bruins claimed F Kaspars Daugavins off waivers from the Ottawa Senators and recalled D Torey Krug from Providence of the AHL. ... Eight of the last nine games between the teams have been decided by one goal. ... The Canadiens' scored a season-high six goals for the third time. The Bruins' scored their season high of five goals for the second time. Boston held a 41-28 advantage in shots on goal.
Copyright by STATS LLC and The Associated Press
BOSTON, MA - MARCH 27: Tuukka Rask #40 of the Boston Bruins walks into the locker prior to the game against the...