BOSTON -- J.D. Martinez had a moment of panic in between home runs when a drive deep to right didn't quite make it out of Fenway Park.
Martinez also doubled twice and drove in four runs for Boston, which is desperately trying to climb back into contention for a wild-card berth after an eight-game losing streak.
"When he gets locked in like this it's fun to watch," manager Alex Cora said.
Albert Pujols hit a three-run homer in the first for the Angels, who have lost eight straight. After Pujols' 18th homer of the season gave Los Angeles a 3-0 lead, the Angels didn't get another hit until the seventh.
Martinez followed his RBI double in the first with a two-run homer off Jaime Barria (4-6) into Boston's bullpen in the fourth to tie it at 3-all. Betts broke the tie in the fifth with a two-run shot off Barria and the Red Sox continued to pull away with a five-run sixth.
Martinez started the rally with a double to right over the head of Kole Calhoun at the warning track. Thinking the ball left the park, Martinez slowed into his home run trot and rounded second before realizing his mistake and scampering back, barely avoiding the tag by shortstop Wilfredo Tovar.
"I turned back and the ball's being thrown in and I go `no way," Martinez said. "I was laughing. I feel like the whole stadium was laughing."
Martinez ended up scoring the first of Boston's five runs that inning, which put the Red Sox in command.
"That was the inning that we blew up. We put up a lot of runs that inning. Thank God I got back," Martinez said.
Two innings later, Martinez was able to trot the whole way after driving one out to right-center for his 27th homer of the season.
The Angels have not won since beating Detroit 6-1 on July 30.
"It's an embarrassing loss, quite frankly. We just didn't pitch, we didn't hit other than Albert's homer in the first," manager Brad Ausmus said. "We really haven't done much of either for the last week. That's what happens when you have losing streaks, when you're not hitting or not pitching."
Boston scored its most runs since a 10-5 win over the New York Yankees on July 26. The two weeks that followed were dismal for the Red Sox, who were still five games out of a wild-card berth after the win.
Cora said the Red Sox are still confident they can make the postseason.
"Pitching wise, we can do it. We'll figure out," Cora said. "I think offensively we can do some special things."
Barria lost his third straight start. He pitched five innings, allowing five runs on six hits and struck out three.
Angels: RHP Griffin Canning (right elbow inflammation) is scheduled for a bullpen session Saturday. ... LHP Adalberto Mejia, reclaimed by the Angels off waivers on Thursday, came out of the bullpen in the sixth. He faced four batters and didn't get an out, allowing two runs on one hit and two walks.
Red Sox: Johnson got the start for LHP David Price, who was placed on the 10-day injured list because of a cyst on his left wrist. Johnson pitched 2 2/3 innings, allowing three runs on two hits. He walked two and struck out one.
Angels: LHP Andrew Heaney (1-3, 5.09 ERA) will be activated from the injured list and make his first start since July 16. Heaney has been out with inflammation in his left shoulder.
Red Sox: RHP Rick Porcello (10-8, 5.54) has won five of his last six starts.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Ex-Dodgers pitcher Yu Darvish: Astros should be stripped of title
Yu Darvish, who was shelled in Games 3 and 7 of the 2017 World Series while with the Dodgers, says that the Astros should be stripped of their title and that players on the team shouldn't be talking right now.
Cardinals' Miles Mikolas misses bullpen session with sore elbow
St. Louis Cardinals pitcher Miles Mikolas was scratched from his second bullpen session of the spring because of a flexor tendon issue.
Brewers sign lefty Brent Suter before arbitration
The Milwaukee Brewers signed left-hander Brent Suter to a two-year contract Sunday, avoiding an arbitration hearing that was scheduled for Monday.
Buster Olney: How Houston Astros deal with backlash will define their season
Fans are sure to send a loud, clear message to Houston players when they come to town, giving the Astros another tough challenge to overcome.
Javier Baez: Cubs not always ready to start last year
Javier Baez says the Cubs weren't always ready to start games last season, so this year will be different.
How will Astros deal with the scrutiny surrounding them?
Buster Olney shares the reactions and feelings of players around MLB in regard to the Astros' punishment for their sign stealing.