ARLINGTON, Texas — Oakland closer Ryan Madson walked from the bullpen into the heart of one of the major leagues’ best lineups on Friday night.

Five batters, all averaging .280 or better, with a one-run lead for Madson to protect. He almost did, but Jonathan Lucroy was the fifth.

Lucroy’s two-run single with two outs in the ninth inning gave the Texas Rangers a 7-6 victory over the Athletics.

Madson had struck out the fourth batter in the inning, Rougned Odor, but pinch-runner Joey Gallo stole second base on the third strike.

“As far as the depth of the lineup and the guys on the bench too, they’re as good as there is in the league, especially with the additions they’ve made,” Oakland manager Bob Melvin said.

“He strikes out Odor, who’s a great hitter in big situations. There were runners on base, but once he got Odor, I thought we were going to win the game.”

Instead, Lucroy hit a ground ball inside third base to drive in pinch-runners Delino DeShields and Gallo.

“I had the big hit,” Lucroy said. “Look, I was 1 for 5 and I came up to hit with runners in scoring position. I was able to sneak one past the third baseman.”

Carlos Beltran’s one-out double began the winning rally. He, Lucroy and Carlos Gomez, who led off the seventh inning with a home run, all have been acquired since July.

Madson (5-6) had his seven blown save in 37 chances.

Sam Dyson (2-2), the Rangers’ fourth pitcher, got the win.

The A’s built a 6-2 lead against Texas starter Cole Hamels on home runs by Khris Davis and Brett Eibner, who drove in four runs.

“My first at-bat, one out, man on third, opportunity to get a run in there and didn’t,” Eibner said. “That kind of really kind of made me bear down on my approach the next two at-bats. When I got the pitches I wanted to hit, I didn’t miss them.”

Davis’ homer was his 38th of the season, his eighth in 14 games against Texas and his third against Hamels in only seven at-bats.

Hamels allowed six earned runs in six innings. In his last four starts, he’s 0-1 with a 10.50 ERA in 18 innings pitched.

After Davis’ homer in the fourth, Ryon Healy hit his second double of the game and scored on Eibner’s two-out single.

Eibner’s sixth homer came with two outs in the sixth.

Hamels was pitching against an Oakland team that scored 43 runs in a four-game sweep at Kansas City.

“We’ve been swinging the bat well,” Melvin said. We expect to score some runs. It’s just trying to keep these guys from scoring more than we do.”

TRAINER’S ROOM

Rangers: RF Shin-Soo Choo, on the disabled list since Aug. 16 with a broken left forearm, will begin swinging a bat, but no date has been established for his return. … RHP Tony Barnette (strained left oblique) is not expected to pitch until the final week of the season.

ERASING A RUN

Texas had a run taken off the scoreboard in the third inning. With the bases loaded and one out, Ian Desmond hit a slow grounder to shortstop Marcus Semien. Desmond reached first base as Mitch Moreland crossed home plate. However, Desmond was called out because Carlos Gomez slid wide of second base to hit second baseman Joey Wendle.

DAVIS STREAKING

Khris Davis has a six-game hitting streak, during which he is 7 for 21 (.333) with three homers and 10 RBIs. . A’s rookie Renato Nunez had his first major league hit, a single, against Hamels in the sixth inning. Nunez is 1 for 8 for Oakland.

BELTRAN PASSES GEHRIG

Carlos Beltran’s two doubles gave him 535 for his career, passing Lou Gehrig for 38th in major league history.

UP NEXT

Athletics: Rookie RHP Raul Alcantara (0-1, 7.27) will start the second game of the three-game series on Saturday.

Rangers: RHP Yu Darvish (5-4, 3.28) is scheduled to pitch on seven days’ rest.