Matt Olson prepped for the Home Run Derby by hitting two of Oakland’s four homers, Chris Bassitt allowed one run in seven innings, and the Athletics beat the Texas Rangers 4-1 on Sunday.

Olson homered leading off the fourth inning and with one out of the sixth, giving him 23 longballs this season. Jed Lowrie and Sean Murphy hit back-to-back homers in the second inning for the A’s, who won consecutive games for the first time since mid-June and took two of three at Texas.

Olson, a first-time All-Star who will participate in Monday night's derby at Coors Field, came into Sunday with one homer in his last 18 games.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

"There’s going to be ups and downs throughout the season," Olson said. "In the past we’ve been a home run-hitting team. It was good to get back and see some leave the yard."

Said Texas manager Chris Woodward: "There’s a saying solo homers don’t beat you, but you give up four, they do."

Bassitt (10-2) gave up four hits, struck out three and walked one to win his career-best 10th straight decision and tie for the AL lead. The All-Star has won his past four starts against the Rangers, including three in the past 18 days. He was coming off a six-run outing at Houston.

"It was more getting back to myself," Bassitt said. "Didn’t feel too good in Houston."

Lou Trivino stranded two runners in the ninth inning for his 14th save in 16 opportunities.

Oakland hit eight homers in two days, with back-to-back homers in the second inning of both games. Lowrie’s drive to straightaway center was nearly caught at the wall by a leaping Eli White, and Murphy followed by blasting an 0-2 pitch to left-center.

The Rangers’ Nick Solak, in a 10-for-55 slump and batting ninth for only the second time this season, hit a one-hop double off the wall in right-center with two out to score David Dahl.

Kolby Allard (2-6) allowed all four homers, striking out three and walking none. He has lost to Oakland three times in 18 days, twice to Bassitt, and has dropped his last five starts against the A’s.

CLOSE PLAYS

The top of the eighth inning was busy for first base umpire Bruce Dreckman.

Frank Schwindel reached when Dreckman ruled Texas first baseman Nathaniel Lowe’s foot barely came off the bag, and the call stood following a challenge.

Woodward went out to speak with Dreckman after his challenge failed.

"If there isn’t clear view down the line, maybe we need to install a camera for that," Woodward said. "It was more like a millimeter off the base. ... That’s not what instant replay’s designed for."

On Ramón Laureano’s subsequent grounder to second, Dreckman called a double play, but Oakland successfully challenged the out at first. Laureano then got caught in rundown between first and second and made it back to first, but was ruled out by Dreckman for leaving the baseline.

SHORT HOPS

It was the Athletics’ first series win since sweeping the Los Angeles Angels from June 14-16. ... Rangers RF Joey Gallo, with 11 home runs in his last 12 games and 24 this season, was given the day off. Gallo will also participate in the Home Run Derby. ... Dahl matched a season high with three hits, doing it twice in the past week.

TRAINER’S ROOM

A’s: Manager Bob Melvin said he’s unsure whether OF Mark Canha (strained left hip) or DH Mitch Moreland (undisclosed) will be ready when the team resumes play after the All-Star break on Friday. Canha played most recently on June 24, Moreland on July 3.

Rangers: C Sam Huff (knee surgery) will begin a rehab assignment with Double-A Frisco on Tuesday.

UP NEXT

The A’s will begin a six-game homestand on Friday with the first of three against the Indians.

Rangers RHP Jordan Lyles (5-5, 4.86) will start on Friday against Toronto at Buffalo, New York, as Texas begins a season-long 10-game road trip. Lyles has won his last three starts after winning two of his first 14 this season.