Wayne Simmonds, Erik Gustafsson, Jake Voracek, Hartnell (two), and Claude Giroux scored goals in the first two periods, giving the Flyers a 6-3 lead.
"There's a reason why it went in tonight," Giroux said. "We were working and winning battles."
Giroux added: "It's almost a little embarrassing that we're not making the playoffs. We're a team that expects to be in the playoffs; we have a team that should be in the playoffs."
Hartnell's first goal - a slot shot after he took a feed from Giroux - gave the Flyers a 4-2 second-period lead and ended their 0-for-17 power-play drought. His second goal, also on the power play, made it 6-3 with 33 seconds left in the second.
With 7 minutes, 15 seconds left in the game, Hartnell completed his first hat trick since Jan. 22, 2012, against Boston.
Voracek, whose pass set up Giroux's tally, scored his 18th goal, equaling his career high - in 36 fewer games than when he reached his personal best last season.
Voracek and Giroux each had a goal and two assists.
Early in the first period, Montreal center Ryan White hit Kent Huskins with a shoulder to the head, sending the Flyers defenseman to the ice with what later was diagnosed as a concussion. He is the fourth Flyers defenseman to be sidelined.
Kurtis Foster went to Huskins' aid and tackled White. Foster received a roughing penalty, five minutes for fighting, and a 10-minute misconduct, while White was given a five-minute elbowing penalty, a fighting major, and a game misconduct. White likely will be suspended.
"That's the part of the game that they're trying to take out," Foster said of White's head hit.
Luke Schenn led the Flyers defense, playing a career-high 33:25, delivering five hits, and blocking four shots.
Canadiens goalie Carey Price was shaky, surrendering two goals on the Flyers' first five shots.
The loss was costly to Montreal, which has a one-point lead over second-place Boston in the Northeast Division.
With three goals in their previous four games, it marked the first time since 2003 that the Flyers had scored one or no goals in four straight contests, according to STATS LLC.
So, naturally, they erupted Monday by equaling their highest goal total of the season, helping goalie Ilya Bryzgalov improve to 18-16-3.
Maybe they were inspired by the news from earlier in the day, when general manager Paul Holmgren almost ensured that Peter Laviolette will return as the Flyers' coach.
Or maybe they were just due.
Contact Sam Carchidi at email@example.com. Follow on Twitter@BroadStBull.