Oakland did all its damage that inning on the way to matching its season-high winning streak.
The A's (57-33) concluded their homestand 6-0, just the 11th undefeated homestand of six or more games in Oakland history. The low-budget club with baseball's best record has won 11 of its past 12 games at the Coliseum.
Gray (9-3) reached eight or more strikeouts for the fourth time in seven impressive innings, having struck out nine twice. He is on a nice roll after losing back-to-back starts to the Orioles and Yankees on June 7 and 13.
It was an impressive first start against the Giants for the right-hander in his first full big league season. He showed his poise on the big stage facing the Tigers twice in last fall's five-game AL division series loss.
The A's have outscored the Giants 11-1 in the first two games of the Bay Bridge Series following a 5-0 win Monday. The interleague series now shifts across San Francisco Bay to AT&T Park for two.
San Francisco avoided being shut out in consecutive games for the first time since July 28-29, 2012, against the Dodgers at AT&T Park. Yet the Giants lost for the 11th time in their past 13 games at Oakland dating to the 2010 season when they went on to win the World Series.
Pablo Sandoval returned to the Giants' lineup for the first time since leaving Saturday's game at San Diego in the first inning with a bruised left elbow.
Giants manager Bruce Bochy requested a review of a close play at first in which Sandoval was called out trying to beat out a fourth-inning grounder. The call was upheld after a replay review of 1 minute, 28 seconds.
Bochy came out again in the eighth to argue after reliever Jean Machi was called for a balk. Machi was then ejected by plate umpire Angel Hernandez as the reliever walked off the field at the end of the inning.
A's starters have thrown six or more innings while allowing one or fewer runs in six straight games, their longest streak since at least 1914.
A's RF Josh Reddick is making progress toward a rehab assignment as he recovers from a strained right knee and his second DL stint. He could play in minor league games as soon as this weekend and during the All-Star break. Reddick has shagged fly balls and thrown without issue the past two days, wearing a bulky brace he expects he will need the rest of the year. ... Oakland manager Bob Melvin presented Oakland's seven All-Stars -- including then-NL All-Star Jeff Samardjiza -- with red jerseys before the game. ... Giants 2B Marco Scutaro, who hasn't played this year because of a lower back strain, went 0 for 4 with two strikeouts and a run scored for Triple-A Fresno. Bochy expects him to soon play nine innings in a rehab game. "We're seeing the light at the end of the tunnel," Bochy said.