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
Braves pull Freeman (elbow) as precaution
Braves first baseman Freddie Freeman was removed from Friday night's game against the Nationals as a precaution because of elbow soreness.
Rizzo's slam among 5 Cubs homers, Chicago rips Bucs 17-8
Anthony Rizzo hit a grand slam, Willson Contreras launched two long solo homers and the Chicago Cubs kept pace in the NL wild-card race with a 17-8 win over the Pittsburgh Pirates on Friday.
Contreras belts 460 and 455 foot homers
Willson Contreras crushes a solo home run to center field in the first inning, then rips another one to center in the third to give the Cubs a 6-4 lead.
Rizzo smashes grand slam in the 3rd
Anthony Rizzo crushes a grand slam to right field in the third inning to give the Cubs a 10-4 lead over the Pirates.
Cubs clobber 5 homers in win vs. Pirates
The Cubs hit three home runs in the first inning and another two in the third in a dominant win vs. the Pirates.
Phillies look to bolster wild-card hopes versus Red Sox
While the Boston Red Sox have bottomed out in the American League wild-card chase, the Philadelphia Phillies are still alive and well in the National League playoff hunt.