PHOENIX (CBSDFW.COM/AP) — The Texas Rangers were only down a run despite being no-hit, so Lance Lynn knew he had to keep them in the game.

Lynn did his job well, and the Rangers’ offense woke up in the later innings. Lynn struck out nine over six solid innings, Hunter Pence homered into Chase Field’s swimming pool and the Rangers rallied after being no-hit for five innings to beat the Arizona Diamondbacks 5-2 Wednesday night.

READ MORE: Luka Scores 26 As The Dallas Mavericks Rally Past The Grizzlies To End Skid

Lynn (1-1) pitched four-hit ball to help Texas end a four-game skid. The Rangers overcame an excellent start from Arizona’s Robbie Ray, who struck out 10 and allowed two hits and a run over five innings.

“I was trying to keep it as close as I can, because he (Ray) had really good stuff,” Lynn said. “We were able to finally get to him there in the sixth and then we were able to scratch a few more, so it was a good team win.”

Andrew Chafin (0-1) pitched out of a bases-loaded, no-out jam in the sixth but was charged with a run an inning later.

Logan Forsythe drove in two for Texas. The Rangers scored two key runs in the top of the ninth off reliever Matt Andriese.

Rangers closer Jose Leclerc, who blew a save chance and a two-run lead Tuesday, loaded the bases with no outs in the bottom of the inning, hitting Carson Kelly and Adam Jones with consecutive pitches after walking Ildemaro Vargas. Leclerc walked Jarrod Dyson to make it 5-2, but Kyle Bird worked out of the jam for his first career save.

“Jose, I wanted to put the ball right back in his hands,” Rangers manager Chris Woodward said. “We’ll get it sorted out. He’s a great kid, and we’ve got 100% confidence in him.”

The Rangers thwarted Ray’s no-hit bid in the sixth with a leadoff single for Delino DeShields. DeShields stole second and took third on a throwing error by Kelly, the catcher. Forsythe singled hard through a drawn-in infield to tie it at 1.

Chafin came on with the bases loaded and struck out Joey Gallo, then got Asdrubal Cabrera to bounce into an inning-ending double play.

The next inning, Chafin walked Isiah Kiner-Falefa, who took second on a sacrifice. One out later, Archie Bradley relieved Chafin and gave up DeShields’ run-scoring hit on a 3-1 pitch.

READ MORE: Discover DFW: Holidays At Reunion Tower

Pence’s first home run of the season gave the Rangers a two-run lead in the eighth. Kiner-Falefa beat the throw home on pinch-hitter Rougned Odor’s ground ball in the ninth, after the Rangers challenged and the out call was overturned.

Odor later scored on Forsythe’s single.

“We did a lot of things well,” Woodward said. “Got a lot of solid at-bats in big spots, good baserunning, obviously Lance had himself a great performance. Just a gritty, gritty game.”

Ray struck out five Rangers in a row between the second and third innings. He also made the game’s best defensive play when he hustled off the mound to scoop up DeShields’ roller and shoveled the ball from his glove to first base for the first out of the fourth inning.

The Diamondbacks took the lead in the third inning. Eduardo Escobar scored on a wild pitch from Lynn.

Ray allowed only three baserunners through the first five innings, none via a hit. They were Forsythe on catcher’s interference in the top of the fourth, Cabrera in the fifth on Escobar’s error at third base and a walk to Kiner-Falefa to put two runners on base in the fifth.

“Felt like everything was working for me,” Ray said. “With the strikeouts, the pitch count got a little elevated.

“They had some tough at-bats. It’s a credit to them, they kept battling,” Ray added.

The Diamondbacks got a second run taken off the scoreboard in the fifth when Escobar’s flyball flew over the fence down the right field line and was originally ruled a home run. After a quick umpire review, the ball was determined to have been hit foul, and Escobar ended up striking out.

The Rangers are now 6-6 on the season and are 4th in the AL West.

MORE NEWS: COVID-19 Omicron Variant Confirmed In 2 North Texas Patients By Frisco Lab

(© Copyright 2019 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)