BOSTON — Hanley Ramirez and Sandy Leon each hit a two-run homer Friday night, and the Boston Red Sox beat the Los Angeles Angels 9-4 to cap a night in which David Ortiz’s number became the latest retired at Fenway Park.

It was the 250th career home run for Ramirez, a good friend of Ortiz who was also born in the Dominican Republic. Leon finished with three hits and four RBI.

The homers helped provide a nice cushion for Rick Porcello (4-9), who gave up four runs and struck out eight in 61/3 innings to earn the victory. It was the 13th straight start Porcello has gone at least six innings.

Angels starter Alex Meyer (3-4) allowed five runs and five hits in 31/3 innings.

Los Angeles scored three runs in the seventh but cooled off after Porcello left.

Boston got out to a 3-0 lead in the first inning, scoring on an RBI double by Xander Bogaerts and then getting two more runs on wild pitches.

Ramirez gave Porcello a 5-1 lead in the fourth with his two-run shot to right field.

This could serve as a needed confidence boost for Porcello, who had been 0-4 with a 7.92 ERA in his previous five starts, allowing 47 hits and 27 earned runs.

He had command of his pitches early, holding the Angels scoreless until the fourth, when a catching error by Leon at home allowed Albert Pujols to cross the plate.

TRAINER’S ROOM

RED SOX: Infielder Josh Rutledge was a pregame scratch because of left hip soreness. Dustin Pedroia, who was only expected to play on an emergency basis, returned to the lineup a day earlier than expected after missing three straight games because of a bruised back.

UP NEXT

ANGELS: Right-hander J.C. Ramirez will be making his 14th start of the season and seventh on the road in 2017. He made four relief appearances last season against Boston. He’s tossed 21/3 scoreless innings in two career games at Fenway.

RED SOX: Left-hander David Price held the Angels to eight scoreless innings the last time he faced them in late July last season. He is 5-5 with a 3.26 ERA over 13 career starts against Los Angeles.