Pastrnak one-timed a pass from Marchand in the left circle for a power-play goal that made it 5-0 at 36 seconds of the third period.
"It was a special game for [Krejci]," Pastrnak said. "We wanted to get a win and for him to fully enjoy it. It was a special night for the whole group. He's an unbelievable player and he deserves the recognition."
Grzelcyk settled a cross-ice pass from Charlie McAvoy and scored over Ersson's blocker for a 6-0 lead at 8:04.
Swayman, who got his first shutout of the season, is 5-0-2 with a 1.83 goals-against average and .936 save percentage in his past seven games.
"The guys in front of me make my job easy," Swayman said. "It's just awesome to be a part of a team like this that shuts it down in front of me and gives me a chance to see the first shot."
NOTES:Pastrnak has 12 points (10 goals, two assists) in the past six games. … Marchand has 13 points (five goals, eight assists) in the past nine games. … Krejci is the fifth player in NHL history with at least three assists in his 1,000th game and the ninth to have at least three points. … Krejci is the seventh player with 1,000 games with the Bruins, joining Ray Bourque (1,518), Johnny Bucyk (1,436), Patrice Bergeron (1,259), Don Sweeney (1,052), Wayne Cashman (1,027) and Zdeno Chara (1,023). ... Bergeron won 16 of 18 face-offs. … The Flyers had their five-game road winning streak end.