Lavarnway, who got the start to due injuries to Jason Varitek and Jarrod Saltalamacchia, cracked his first major-league homer in the fourth, a three-run shot that put Boston up 5-1. His solo clout in the eighth gave the Red Sox an insurance run that turned out to be the difference in the victory -- which kept the Red Sox knotted with Tampa Bay for the wild-card lead with one game remaining.
The Rays had defeated the New York Yankees 5-3 earlier Monday.
Should Boston and Tampa Bay both win or both lose their Wednesday games, a one-game playoff would be held Thursday in St. Petersburg, Fla.
Alfredo Aceves (10-2) earned the victory with 3 2/3 innings of one-run relief and Jonathan Papelbon notched his 31st save despite a shaky ninth in which he allowed a run and stranded the tying run at third.
Orioles starter Zach Britton (11-11) allowed five runs on seven hits over 4 1/3 innings.