Lavarnway let four pitches from knuckleballer Steven Wright get away from him in the first inning alone before stroking a two-out double in the fifth inning that put Boston ahead 8-7.
The Red Sox scored a total of 10 runs in the fifth and sixth innings and then added two more in the seventh to win their eighth game in 11 outings.
Wright lasted just one inning in his first career start and reliever Brandon Workman (2-1) was credited with the win despite allowing six runs in 4 2/3 innings.
Jordan Lyles (4-6) took the loss for Houston despite working off a 7-3 lead after four innings. Robbie Grossman, Brett Wallace and Jake Elmore homered for the Astros.