SAN JOSE, Calif. — Tyler Kennedy, fresh off the injured list, scored two goals — including the winner — and the San Jose Sharks beat the Boston Bruins 7-4 on Thursday night for their third straight victory.

Tommy Wingels and Joe Pavelski also scored twice for the Sharks, who snapped a three-game losing streak to the Bruins. Tomas Hertl added a late goal.

The Sharks scored twice on the power play, giving them seven man-advantage goals in seven games after being shut out in their previous four.

Reilly Smith scored twice for the Bruins, who ended a scoring drought but extended their losing streak to three. Gregory Campbell and Torey Krug also scored.

Antti Niemi made 20 saves in winning his third straight. Tuukka Rask stopped 37 shots in losing to the Sharks for the first time in four games.

The Bruins hadn't scored more than two goals in a game since a 4-3 win over Columbus on Nov. 21. They scored twice in the first three minutes against the Sharks.

San Jose scored four goals in the second period to erase a 2-0 deficit. The Bruins also scored twice in the period, and the game was tied 4-4 entering the third.

Kennedy redirected a shot from Matt Irwin that clanked off the crossbar and into the net just over three minutes into the final frame.

Wingels deflected a shot from Marc-Edouard Vlasic 27 seconds into the period, and then steered in another shot by Irwin.

Kennedy scored his first goal with a redirection over Rask's shoulder. Pavelski scored on a power play, punching the puck in off Rask's pads.

Smith scored his second goal by finding a space between Niemi and a defenseman after Carl Soderberg set him up with a nice pass. Torey Krug scored after taking a pass from Brad Marchand.

Smith scored less than 30 seconds into the game with a wide-open shot into the net off a feed from Patrice Bergeron.

Campbell scored after a back-handed pass from Daniel Paille.

NOTES: Bruins D Dennis Seidenberg ended a five-game point drought with an assist on Campbell's goal. . Sharks C Logan Couture passed concussion tests before game and was cleared to play. ... Rask was 3-0 with a 1.33 career GAA against the Sharks entering the game. ... The Bruins scored more than two goals for just the second time in 11 games after doing so eight times in the previous 12. ... Boston has allowed the first goal in 11 of 15 games. ... The Sharks scored four goals in a period for the second time. ... Sharks D Brendan Dillon recorded his first point with San Jose.