Boston deadlocked the Eastern Conference quarterfinal series at 2-2 and will host Game 5 Saturday. The visiting team has won every game in the series.
The Bruins came back from a two-goal deficit in the second period and then fell behind again when Montreal's P.K. Subban scored a power-play goal 1:39 into the third.
Chris Kelley forced overtime when he scored with 6:18 to go in regulation.
Ryder's game-winning goal was his second of the contest. He also had an assist on Kelly's goal that brought about a 4-4 tie.
Mike Cammalleri and Andrei Kostitsyn produced goals 55 seconds apart midway through the second period to give Montreal a 3-1 advantage. Andrew Ference and Patrice Bergeron tallied before the period was over to tie the contest.
Tim Thomas got the win with 34 saves. Carey Price gave up five goals on 35 shots.