Erik Bedard's winless streak stretched on, and this time it was a pair of Oakland rookies that sent him to another loss.
Bedard was knocked out in the fifth inning and Houston managed just five hits in a 5-0 loss to the Athletics that prevented a three-game sweep by the Astros.
Sonny Gray pitched eight innings of four-hit ball in his home debut for Oakland, and fellow rookie Nate Freiman went 4 for 4 with a two-run homer and four RBIs.
"He gets good at-bats. I certainly can't get him out," Bedard said. "It wasn't a good start. They got the call and it was two runs right off the bat. I was just not throwing enough strikes."
Bedard (3-9) was charged with five runs and seven hits in 4 2-3 innings. The veteran left-hander is 0-6 with a 4.57 ERA in his last eight starts in the longest losing streak of his career.
The 23-year-old Gray (1-1) struck out nine while throwing 118 pitches in his second career start and fourth big league appearance. Like so many other young pitchers in the A's organization, the top prospect has been on the fast track to the majors since Oakland drafted him in the first round at No. 18 overall in the 2011 amateur draft.
Freiman had a two-run double in the first, and then hit his third home run in the third with a drive to the left-field stands.
"Pretty special day for both those guys," manager Bob Melvin said.
Melvin asked Gray after the seventh how he felt, and the pitcher wanted to keep going.
"It was good for him to have the confidence in me to leave me out there," Gray said.
Gray still had his best stuff in the late innings. He retired leadoff man Robbie Grossman on a called third strike in the eighth, and then left to a warm ovation from an announced crowd of 16,487 at the Oakland Coliseum. Fans yelled, "Come on, Sonny!"
Dan Otero finished the five-hitter for Oakland's 10th shutout.
Houston never found any kind of groove against Gray.
"He got us to expand the zone," manager Bo Porter said. "He pitched a tremendous game."
Freiman added singles to his impressive day in the fifth and seventh innings. He is batting .315 (40 for 127) since May 1 after batting .148 in April.
For the A's, a sweep by the Astros would have been demoralizing. They already had lost two in a row to Houston each by one run, including in 11 innings Wednesday night.
Oakland pulled within 1½ games of idle first-place Texas in the AL West, avoiding falling three back for biggest deficit since May 31.
The Astros still left the Bay Area feeling positive about this stop.
"It's always good to walk away with a series win. Today their guy on the mound was pretty dominating and better than our guy," Porter said.
After Chris Young beat out an infield single leading off the bottom of the first, Jed Lowrie hit an RBI double to stake Gray to a quick lead. Lowrie was the designated hitter rather than playing his usual shortstop spot as he nurses a sore lower right leg after being hit by a pitch Tuesday.
Three batters after Lowrie, Freiman doubled in two runs.
Bedard's day only got tougher. The lefty allowed five runs and seven hits and is winless in his last three outings against the A's since a victory at Oakland for Seattle on May 27, 2009.
Houston's Chris Carter hit a liner at ex-A's teammate and shortstop Eric Sogard in the seventh and the barrel of Carter's bat broke off, sailed through the air and struck Sogard in the left leg. He stayed in the game.
NOTES: Houston OF Marc Krauss is in a 1-for-18 stretch. ... Grossman has hit safely in 14 of 17 games since being recalled from Triple-A Oklahoma City on July 27. ... Umpire Angel Hernandez was booed by the crowd when announced before the game for his calls the entire series.