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
Mariano Rivera: Healthcare workers are the real heroes
Former Yankee Mariano Rivera expresses extreme gratitude for the healthcare workers on the front line of the coronavirus pandemic.
Is it safe to start the MLB season in May?
Jeff Passan gives an inside look into the MLB's decision to potentially start the season in May and the health concerns that come with it.
Sources: MLB, union focused on plan that could allow season to start as early as May in Arizona
Major League Baseball and its players are increasingly focused on a plan that could allow them to start the season as early as May in the greater Phoenix area and has the support of high-ranking federal public health officials, sources told ESPN.
Javy Baez catches for Jose Berrios
Cubs Javier Baez plays catcher for Minnesota Twins pitcher Jose Berrios
Former Colorado Rockies All-Star Todd Helton sentenced to two days in jail following DUI arrest
Todd Helton, a retired All-Star first baseman who played for the Colorado Rockies, was sentenced to two days in jail after a DUI arrest in Tennessee.
How baseball players are using Twitch to connect with fans
Joon Lee details how MLB players are using Twitch, Xbox Live and PlayStation Network as ways to connect with fans while the MLB season is on hold.