SAN FRANCISCO (AP) – Robbie Ray pitched six scoreless innings, Jake Lamb continued to slug against the Giants by tripling home a run and the Arizona Diamondbacks beat San Francisco 3-0 on Tuesday night.

Jean Segura and Paul Goldschmidt also drove in runs for the Diamondbacks, who won their fourth in five games and have taken 10 of 12 at AT&T Park.

Ray (1-0) retired eight of nine during one stretch and gave up five hits. He matched his career high with eight strikeouts and walked two.

Matt Duffy had two hits for the Giants, who have lost six of seven after winning six of their first eight. He entered the contest hitless in 13 at-bats and 2 for 24 over his previous seven games.

Matt Cain (0-2) took a no-hitter into the fifth inning but then allowed three runs and five hits before being pulled after 4 2/3 innings. It’s the second time in five starts that Cain hasn’t finished the fifth.

Cain walked four and struck out two in his 4 2/3 inning stint.

Lamb hit his triple in the fifth inning. He had a tying home run with two outs in the ninth inning and doubled in an insurance run in the 11th in a 9-7 win over San Francisco on Monday night.

Andrew Chafin and Evan Marshall each pitched a scoreless inning and Tyler Clippard worked the ninth for his first save. Clippard has not allowed a run in six innings, a span of six games.

Clippard walked Duffy to open the ninth but came back to retire the next three hitters.

The Giants bullpen also held Arizona in check, giving up three hits over 4 1/3 scoreless innings, including two innings by Steven Okert in his major league debut. San Francisco relievers combined to strike out six.

Chris Owings added a pair of hits for the Diamondbacks.TRAINER’S ROOM

Diamondbacks: RHP Silvino Bracho was recalled from Triple-A Reno. RHP Archie Bradley, who made a spot start Monday night, was optioned to Reno to make room.

Giants: RHP George Kontos was placed on the 15-day DL with a strained flexor tendon in his pitching arm, retroactive to April 18 and RHP Chris Heston was optioned To Triple-A Sacramento. … LHP Steven Okert was recalled from Triple-A Sacramento along with RHP Mike Broadway.UP NEXT

Diamondbacks: RHP Zack Greinke (0-2, 6.75) starts on Wednesday night. He’s the only pitcher to start against the Giants at least 10 times and remain undefeated – he’s 7-0.