Henry Sosa pitched six innings to record 1 win over the Giants.
In just his fourth big league start, the 26-year-old right-hander allowed four hits and a run over six frames. Sosa (1-2), who was acquired from San Francisco on July 19 along with Double-A pitcher Jason Stoffel in exchange for infielder Jeff Keppinger, walked three and fanned the same number of hitters.
Jordan Schafer homered for the Astros in the opener of this four-game series.
Ryan Vogelsong (10-4) surrendered six hits and three runs over 7 1/3 innings to lose back-to-back starts for the first time this season.
The loss, San Francisco's fifth in seven contests, left the Giants three games behind first-place Arizona in the NL West. The Diamondbacks won at Washington Thursday night.
The Giants have lost the opener of a series 11 straight times.