The Sabres won their third in a row, one shy of their longest such streak of the season.
Boston took the lead in the shootout when David Krejci scored in the first round, but Thomas Vanek tied it in the second. After Roy gave the Sabres a chance at victory, Boston's Benoit Pouliot missed the net.
Andrej Sekera scored the only regulation goal for Buffalo, with 5:15 to go in the second period. Zdeno Chara delivered a power-play goal 3:36 into the third to tie it.
Ryan Miller made 35 saves to get the victory while Rask stopped 26-of-27 shots.
With Boston set to visit Ottawa Saturday to play the Senators -- with the Northeast Division lead on the line -- Rask got the start Friday over Tim Thomas. Rask has lost in each of last six appearances.
The game in Ottawa will conclude Boston's six-game road trip, on which the Bruins are 2-3.
UPI horse racing weekend preview
Bo Jackson: I can't help Jameis Winston anymore