A pair of third-period goals created by the fourth line gave the Bruins a 2-1 win in Game 3 of their playoff series against the Rangers Tuesday night at Madison Square Garden.

At 3:10 of the third, the Bruins tied the game at 1-1. Daniel Paille, Gregory Campbell, and Shawn Thornton won multiple races for the puck. Paille got the puck to Johnny Boychuk at the right point. With Thornton and Campbell providing traffic in front, Boychuk snapped a shot past Henrik Lundqvist.

Paille scored the winner at 16:29 of the third. After the puck got behind Lundqvist, Paille peeled around the net and hammered the puck home to give the Bruins a 2-1 lead.

The Bruins can go for the sweep in Game 4 Thursday night at MSG.

The Rangers, fighting for their first win of the series, took a 1-0 lead into the third period.

The Rangers scored their goal following an offensive-zone faceoff. Derek Stepan beat Patrice Bergeron cleanly on the draw. Bergeron regained control of the puck after the loss and tried to backhand it out of the zone. But he couldn’t get enough muscle behind his clearing attempt. Ryan McDonagh intercepted Bergeron’s backhander.

As McDonagh looked for a shot from the left point, Taylor Pyatt battled with Dougie Hamilton in front of the net, creating a screen on Tuukka Rask. Hamilton couldn’t move the 6-foot-4-inch, 230-pound Pyatt. McDonagh snapped a shot on goal that deflected off Pyatt and beat Rask at 3:53 of the second period to give the Rangers a 1-0 lead.

The Bruins pushed back later in the second. Their best chance took place on a two-shot sequence. Lundqvist stopped a Torey Krug blast. On the rebound, Nathan Horton, who had been setting a screen on Lundqvist on the Krug shot, turned and fired a followup shot on net. But Horton’s shot glanced off the right post at 13:25.

Lundqvist, sharp in the first period, continued to sparkle in the second. He flashed his glove at 11:36 to snatch a Campbell attempt.

On the next shift, Lundqvist took advantage of a quick whistle. Bergeron snapped off a shot that Lundqvist stopped at 11:58. But the puck popped free. Brad Marchand drove to the net in pursuit of the rebound. But the play was whistled dead with the puck loose in the crease.

Neither team scored in the first period. The Rangers held an 11-9 shot advantage. But Lundqvist faced far more challenging shots in the opening 20 minutes than Rask. Lundqvist was up to the task.

The Vezina Trophy finalist was leaky in the first two games. But Lundqvist was perfect through 20 minutes. He had to stare down two breakaways, both after two right-shot New York defensemen let their men barrel through.