Ortiz's solo shot in the third inning was one of three Boston homers on the day. Mike Napoli added a solo blast in the sixth and Corey Brown went deep with none aboard in the eighth.
Will Middlebrooks went 2-for-3 with two RBI for the Red Sox, with Brown also collecting a pair of hits in the win.
Lester yielded just one hit and a walk while striking out four before giving way to Chris Capuano, who allowed a solo homer to Evan Longoria while working the next three frames.
Longoria finished 2-for-2, while Rays starter Jake Odorizzi permitted one run and two hits over the first 2 1/3 innings.