By Jenny Masters

Just as the Flyers were starting to rise from the ashes and make a run at an NHL playoffs spot, the Boston Bruins kicked them in the teeth.

Patrice Bergeron had a hat trick and reached 900 career points, and Brad Marchand’s short-handed goal led the Bruins to a 4-2 win at the Wells last night.

The Flyers beat the Bruins 3-2 on Travis Sanheim’s overtime goal a night earlier for their first win in six games in the series this season.

“What an incredible experience,” Swayman said. “To get a win here in Philly, it means everything.”

Marchand’s goal midway through the third period helped put more distance between the Bruins and Flyers for the final playoff spot in the East Division. The Bruins now hold a five-point lead over the Flyers for fourth.

Bergeron added an empty-netter in the final minute.

Jake Voracek and Shayne Gostisbehere scored for the Flyers.

The Flyers Carter Hart, who has been ineffective for more than a month, was outplayed by another 22-year-old goalie, Jeremy Swayman, who survived a 25-shot second period and he made 40 saves.

Swayman’s NHL debut made him the fourth goalie to play for the Bruins this season. Jaroslav Halak tested positive for COVID-19 and Tuukka Rask is still sidelined with an undisclosed upper-body injury. Dan Vladar made 29 saves in the first game of the back-to-back set.

Bergeron’s three-goal effort — he has 15 goals this season — helped the Bruins split the home-and-home set.

Bergeron hit the 900-point milestone just 7:09 into the game with his 13th goal of the season. He joined Ray Bourque (1,506), Johnny Bucyk (1,339) and Phil Esposito (1,012) as players who scored 900 points with the Bruins.

Swayman stopped Scott Laughton on a breakaway and Bergeron scored his second goal off the rush from the slot for a 2-0 lead. He now has seven goals in seven games this season against the Flyers.

Needing every point they can get, the Flyers gamely rallied in the second.

Voracek tapped in Travis Konecny’s shot from the circle to make it a 2-1 game. The Flyers needed about 90 seconds to even the score on Voracek’s cross-ice pass to Gostisbehere for his sixth goal of the season.

Gostisbehere has already scored more goals than the five he had in 42 games last season — and that includes a stint on the waiver wire. The 27-year-old defenseman was placed on waivers last week and went unclaimed. Gostisbehere said he tried not to take the decision personally — the Flyers gained some salary cap flexibility with the move — and he fit right back in as the Flyers make a playoff push with 18 games left this season.

“It’s a tough loss but there’s plenty of points still out there,” Flyers forward Oskar Lindblom said.

Swayman was a Hobey Baker finalist last season as best player in college hockey at the University of Maine. He went 8-1-1 with a 1.89 goals against average in the minors this season. The Flyers took only four shots in the third.

“It seems like the future is bright, so it’s always a great sign,” Bergeron said.