The Phillies were trailing 5-2 in the fourth when Freddy Galvis cracked a two-run shot, drawing them to within a run. Ortiz gave the Red Sox some insurance in the next half-inning when he got to Philadelphia starter Joe Blanton (4-4) for his ninth home run of the year.
Mike Aviles, Will Middlebrooks and Jarrod Saltalamacchia (3-for-4) each added a bases-empty clout for the Red Sox, who evened their three-game series at Citizens Bank Park.
Jon Lester (3-3) recorded the win, yielding four runs on eight hits over six innings.
Blanton was lit up for seven runs (six earned) on nine hits in a 4 1/3-inning start.
Shane Victorino and Hector Luna each had three hits and an RBI for the Phillies.