NEWARK, N.J. — Patrice Bergeron scored twice and reached the 30-goal mark for the fifth time and the streaking Boston Bruins beat the injury-ravaged New Jersey Devils 5-1 on Thursday night to open a six-point lead over Toronto in the race for second place in the Atlantic Division.

David Pastrnak, Danton Heinen and David Backes also scored for the Bruins, who are 16-3-1 in their last 20 games. Tuukka Rask made 22 saves to improve to 18-2-3 in his last 23 games.

Boston, which has given up two goals while winning its last three games, and the Maple Leafs, who were idle, each have eight regular-season games left.

Drew Stafford scored for the Devils, ending a 34-game goal-scoring drought. Cory Schneider made 22 saves as New Jersey lost for the ninth time in 12 games (2-9-1).

Boston’s top line of Bergeron, Pastrnak and Brad Marchand combined for eight points in the game, including the first two goals.

Bergeron opened the scoring with 1:26 left in the first period with his 29th goal. Pastrnak took the puck from Marchand and made a pass across the crease to a Bergeron for a shot into an open net.

Pastrnak, who just returned from thumb surgery, got his 32nd at 12:58 of the second period. Bergeron won a faceoff and Marchand made the pass across the crease for Pastrnak’s shot into an open net.

A Bruins turnover allowed the Devils to score less than two minutes later. Pavel Zacha, who returned after missing 16 games with an upper-body injury, got the puck in the right circle and found Stafford for his third goal.

Heinen restored the two-goal lead 29 seconds into the third period. Sean Kuraly blocked a shot by Devils defenseman Steven Santini with his glove and Heinen scored on the ensuing rush.

Bergeron scored into an empty net with 1:18 to play, and Backes tallied in the final minute.