Smith gave the Bruins a 1-0 lead with a tap-in from the top of the crease at 1:21 of the first. Riley Sheahan's shorthanded goal at 12:35 tied it 1-1.
Sean Kuraly put Boston ahead 2-1 at 16:38 when he scored his first goal in 31 games, since Feb. 5.
"It feels good," Kuraly said. "That's the name of the game, I guess. There's a lot of other things you try to take pride in, but at the end of the day, putting the puck in the net feels pretty good."
Patrice Bergeron scored at 5:36 of the second period to give the Bruins a 3-1 lead. Nick Ritchie made it 4-1 at 3:18 of the third period, and Smith extended it to 5-1 at 5:31.
"We didn't play our game, really," Sabres defenseman Rasmus Dahlin said. "They came out really hard, they needed these points and they [played] a really good game. They don't give us anything, so I think a little bit of frustration came through and we slipped away from our game."
Arttu Ruotsalainen scored for Buffalo at 7:02 to make it 5-2.
Smith completed his second NHL hat trick during a power play at 14:05 with a redirection of Krejci's pass for a 6-2 Bruins lead.
"It was great," Smith said. "Krejci told me before our shift, he goes, 'Just get your stick down, I'm going to try to shoot it at you every time.' It just happened to be the first one he shot, so I was just laughing with him the whole time. It was cool seeing the hats fly, I don't get to see it very often for myself."
NOTES:Buffalo forward Casey Mittelstadt had two assists to extend his point streak to five games (two goals, four assists). ... Sheahan's goal was the fifth shorthanded by the Sabres this season and sixth allowed by the Bruins. … Boston forwards Karson Kuhlman and Jake DeBrusk replaced Chris Wagner (undisclosed) and Trent Frederic (healthy scratch). Kuhlman had a game-high six shots on goal. ... The Pittsburgh Penguins, Washington Capitals and New York Islanders have clinched berths in the East Division.