Sometimes, said Dustin Tokarski, you get the breaks.

Tokarski, who made 39 saves to lead the Canadiens to a 4-3 shootout win over the Anaheim Ducks Wednesday night, didn't get the break when Francois Beauchemin scored on a freak goal in the second period.

But the hockey gods smiled on the backup goaltender when he had a helping hand from two posts.

Tokarski thought Kyle Palmieri scored what would have been the winning goal in the fifth round of the shootout. But the puck hit one post, caromed off the other and then slid along the goal line without crossing it.

"I definitely thought it was behind me," said Tokarski, who was a winner in his first NHL game in two years. "I was upset but I guess you have to get some breaks sometimes."

With Carey Price on the sidelines with a lower-body injury, Peter Budaj has been shouldering the load. But, with back-to-back games, coach Michel Therrien decided to use Tokarski here and go with Budaj Thursday in Phoenix.

Therrien said he delayed telling Tokarski he was playing until Wednesday morning because "I wanted him to get a good night's sleep."

The Canadiens were strong out of the gate. Brian Gionta and Max Pacioretty scored to give the Canadiens a 2-0 lead, and the game was more than 10 minutes old when Ryan Getzlaf had Anaheim's first shot on goal.

"I was a little nervous at the beginning but it's good to have nerves," said Tokarski. "At the end of the first period, I got some shots after not getting any and I felt good going into the second period."

That feeling wasn't shared by his teammates, who didn't have a good period. Tim Jackman, Beauchemin and Daniel Winnik scorerd to give Anaheim a 3-2 lead before Brendan Gallagher tied it with 35.9 seconds remaining in the second period.

Beauchemin scored when his harmless dump-in on a power play hit a support along the glass and changed direction.