BOSTON — Special players tend to do special things at special times.

Ottawa Senators defenseman Erik Karlsson is a special player.

Wednesday night, Karlsson shot a puck intentionally wide to the right of Boston Bruins goaltender Tuukka Rask. Bobby Ryan, in behind rookie defenseman Charlie McAvoy, took the puck off the back boards and slipped it home for the only goal in a 1-0 Game 4 victory that put the Senators on the brink of advancing to the Eastern Conference semifinals.

“I almost gave up on it too and just kind of went to the net,” Ryan said after his second straight game winner — this one 5:49 into the third period. “I waited just long enough to see it come in.

“The poise, especially under pressure — he’s skating backwards with guys coming at him. I don’t know if you can say enough about it. All-world play.”

Craig Anderson stopped 22 shots for his fourth career playoff shutout and the Senators, playing their usual tight-checking game, went up 3-1 in a series they can end Friday night in Ottawa. A win would advance them to meet the winner of the Montreal Canadiens-New York Rangers series, which is currently tied 2-2.

Boston is 0-22 when trailing 3-1 in a seven-game series, according to STATS, Inc.

Ryan scored his third goal of the series and his fourth in five games dating back to a regular season that finally saw him snap a 13-game goal-scoring drought.

“I had a good feeling,” Ryan said of the winner. “(Karlsson) sees plays that the rest of us just don’t. I knew it was going to be the vicinity. It hit my stick and just died on it and gave me an opportunity to put it in. Just the perfect pass.”

Zdeno Chara dove at the puck as it trickled over the goal line but even the tallest player in NHL history couldn’t prevent the goal.

Anderson denied Brad Marchand on two breakaways in the first period, stopping a backhander headed for the five-hole and the other with the goalie diving out for a poke check.

Asked about the second save, Anderson said, “Johnny Bower. When I was in junior, I had Johnny Bower for a day. That was the story, the first time he ever came out sliding at a guy. He was nervous, I was nervous. You know, I’m just glad it worked out.”

Marchand, a 39-goal scorer in the regular season who recorded the winner in Game 1 of the series, has been blanked in the last three games. He had six of the 22 shots and was robbed on a late rebound and also stopped on another shot after Rask was pulled — all after the Bruins went nearly 10 minutes without a shot.

“He got us to the third period by playing unbelievable,” Karlsson said. “He shut it down for us, and we found a way to score a goal. “Andy was a rock for us and probably stole this one for us.”

The Bruins thought they had taken a 1-0 lead 10:49 into the second period when Riley Nash got the puck back to McAvoy. The defenseman, playing in his fourth NHL game, beat Anderson from the right point with the help of a deflection off an Ottawa player. But a challenge of an offside committed almost 20 seconds earlier showed Boston’s Noel Acciari was offside and the goal was erased.

The Senators made it 7-1 against Boston this season with their fifth straight victory at TD Garden dating back to last season.

Rask made 26 saves.

“They’re a good team; you have to give them credit,” Marchand said. “They’re playing well and their goalie played a good game tonight.

“We’ve been in situations like this before; we have to worry about the next game.”

The loss capped a dreadful four days for Boston’s two indoor teams.

With the Bruins losing Monday and Wednesday and the NBA Celtics on Sunday and Tuesday, it was the fourth time in the history of the two Boston Gardens the teams had lost on four straight nights in the postseason — only the second time they both lost twice in the four nights, according to STATS, Inc.

In 1969, the Bruins lost twice to the Montreal Canadiens and the Celtics twice to the Los Angeles Lakers.

NOTES: Boston D Colin Miller returned after missing the first three games of the series with a lower-body injury, while D Tommy Cross, who made his playoff debut in Game 3, was scratched. … Ottawa coach Guy Boucher said D Mark Borowiecki “is getting closer every day” but Borowiecki missed his second straight with a leg injury as the Senators lineup remained the same. … The overtime wins in Games 2 and 3 marked the first time in franchise history Ottawa has won back-to-back games in OT. … Bruins C Patrice Bergeron is a finalist for the Selke Trophy (best defensive forward) for the sixth straight year. He has won the award three times. … Ottawa’s Tom Pyatt left the game in the first period after suffering a hit to the head on a check from Kevan Miller.