SAN FRANCISCO (AP) Robbie Ray had all of his pitches working, and Arizona had enough offense to support him.
Ray pitched six scoreless innings, Jake Lamb continued to slug against the Giants by tripling home a run and the Diamondbacks beat San Francisco 3-0 on Tuesday night.
''My breaking ball was the best it's been all year but mainly I was my fastball command,'' Ray said. ''Everything was working.''
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.
''The team is playing great,'' Ray said. ''We're swinging the bats well and the defense is making plays behind us.''
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.
''A well-pitched game by Robbie,'' Diamondbacks manager Chip Hale said. ''He had lights off stuff. His fastball was unhittable.''
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.
''I just seem to be making mistakes in that fifth inning and it keeps getting me,'' Cain said. ''I just have to make better pitches.''
Cain walked four and struck out two.
Lamb hit his triple in the fifth inning. He had a game-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.
RETURN TO START
Right-hander Chris Heston, who took the loss Monday night, was optioned to Triple-A Sacramento before Tuesday's game. Heston, a starter for most of his career, began the season in the bullpen. ''We're going to start him every fifth game and get him back on track,'' Giants manager Bruce Bochy said. ''He'll be back up here.''
IN THE ZONE
Hale thinks Arizona is thriving in San Francisco because players enjoy the atmosphere.
''The fans are into the game and it's always a sellout,'' Hale said. ''Our guys like that and rise to the occasion.''
Chris Owings agreed.
''It's a fun place to play,'' he said. ''It gets everybody excited.''
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. ... Okert was recalled from Triple-A Sacramento along with RHP Mike Broadway.
Diamondbacks: RHP Zack Greinke (0-2, 6.75) starts Wednesday night. He's the only pitcher to start against the Giants at least 10 times and remain undefeated - he's 7-0.
Giants: LHP Madison Bumgarner (1-1, 4.50) gets the start Wednesday night. The three-time All-Star is 8-6 with a 2.54 ERA in 23 games against the Diamondbacks.