Berube got the result he was seeking by making the change.
"I thought Raff the last couple of games on the road was really good and I liked what I saw and wanted to make a change, and it ended up working out," Berube said.
The Flyers (14-15-3) spoiled the return of former teammate Danny Briere, a Canadiens forward, as Montreal dropped to 19-11-3.
Raffl opened the scoring with 6 minutes, 3 seconds left in the first period.
Voracek took a feed from Giroux behind the net and fed Raffl. From the slot Raffl scored the second goal of his career and his second in three games.
Giroux "got the puck to Jake behind the net and he's so strong one against one," Raffl said. "I was just trying to get open in the slot and he hit me perfect."
Raffl's father was in attendance for his first goal at the Wells Fargo Center.
"I was so happy when I saw him this morning," said Raffl, who is from Austria. "He didn't get the chance to watch so many games that I played and I don't think he ever saw an NHL game, so that's something special for me tonight."
The Flyers controlled the first period, outshooting the Canadiens, 9-4. Shortly before Raffl's goal, Montreal goalie Carey Price made an outstanding save on Wayne Simmonds from the right circle. Simmonds received a pass from behind the goal from Brayden Schenn.
Although Montreal picked up the pace in the second period, the Flyers extended the lead to 2-0 on Giroux's sixth goal.
Braden Schenn found Voracek outside the left circle. Voracek sent a cross-ice pass to Giroux, who scored from the right circle with 10:17 left in the period.
Shortly after, Price made a glove save on Simmonds shot from the slot as the Flyers continued to pressure.
With 3:45 left in the second period, Montreal's Alexei Emelin upended Steve Downie near the boards and was called for a five-minute major for elbowing. He was also assessed a game misconduct.
The Flyers failed to score on the extended power play. Price kept the Canadiens in the game by stopping Brayden Schenn on a breakaway late in the second period.
Montreal was still hanging around. Flyers goalie Steve Mason made some big saves, including one on a slap shot from the slot by Brian Gionta with 15:05 left.
With 6:35 left, Gionta had a goal disallowed when it was ruled on that he pushed the puck in with his glove as he slid in on goal.
With 55.1 seconds left and Montreal's goalie pulled, Alex Galchenyuk scored for the Canadiens.
The Flyers held on to win, but there was a scrum at the finish as Mason and Gionta went at it. Montreal's Brendan Gallagher jumped in, as did the Flyers' Matt Read, before the teams were separated.