David Pastrnak scored, and Tuukka Rask made 26 saves for the Bruins (36-26-6), who won their second straight game and are 10-3-0 under coach Bruce Cassidy. The Bruins were outshot 9-4 in the second period but outshot the Flyers 12-4 in the third.
WATCH: All Flyers vs. Bruins highlights
"We knew we didn't have a great second period, so we made a couple adjustments on our breakout," Cassidy said. "I thought they were doing a real good job on the forecheck, putting us in bad spots in the second period, and we got hemmed in our end. As a result, we had no flow in that period. So that was one thing.
"The message mostly was sometimes you've got to win 5-4 and sometimes it's 2-1. And it was shaping up to be a 2-1 game, so let's accept it, manage the puck, play tight, and if we get an opportunity let's make sure we bear down. And we did have some because we were cleaner in our end and we managed the puck better."
The Bruins are two points ahead of the Toronto Maple Leafs for third place in the Atlantic Division.
Jordan Weal scored, and Mason made 25 saves for the Flyers (31-28-8), who have lost two in a row and three of their past four (1-2-1). They trail the New York Islanders by five points for the second wild card into the Stanley Cup Playoffs from the Eastern Conference.