HOUSTON - Barry Bonds homered for a career high. Armando Rios homered for his grandmother.
Bonds hit his career-best 47th home run, and Rios hit a solo homer in the ninth inning to break a tie and lift the San Francisco Giants over the Houston Astros 3-2 Wednesday night.
Bonds homered in his third straight game for the NL West leaders, connecting for a solo shot in the seventh inning off rookie Wade Miller.
''I'm going to hit the ball out anywhere, I don't know how many, I just want to win, just win,'' Bonds said.
Bonds broke his previous best of 46 set in 1993, his first season with the Giants. The All-Star outfielder's eighth homer of the month was the 492nd of his career, one behind Lou Gehrig for 17th place on the all-time list.
Bonds downplayed the significance of his record breaker. Rios, knew that his game-winner was special.
''My grandmother passed away on Friday, I know that she is in heaven and this was for her,'' said Rios after hitting his 10th homer with two outs in the ninth off Miller (5-6). ''This is the biggest moment in my career. I wanted to stay with my family but they all said to go hit a home run for her and win a game and she will know.''
The Giants completed a three-game sweep and improved to 6-0 overall at Enron Field.
Livan Hernandez (15-10) pitched eight innings for the victory. Robb Nen got his 36th save, converting his 23rd straight chance.
''He's the most mystical pitcher in the league,'' Astros manager Larry Dierker said of Hernandez ''He throws stuff up there that looks like nothing and throws it high and he doesn't throw very hard. Hitters come back shaking their heads.
''It's not just us, he does it to everyone.''
Miller took a three-hitter and a 2-0 lead into the seventh. Bonds led off with his homer, Jeff Kent and J.T. Snow hit consecutive doubles to tie it.
Rios then singled, but was caught trying to take second. Miller preserved the tie when he got Bobby Estalella to pop up and Hernandez to strike out.
Miller didn't allow a runner to reach second base until the Giants rallied in the seventh. He struck out four and walked one as the Giants snapped his three-game winning streak.
''I felt pretty confident, I knew I had my best stuff,'' Miller said. ''Everything was working. My fastball was the best it's been. I had control of my curve and slider. I felt I could throw any pitch any time. It's a downer to lose 3-2 but that happens.''
Richard Hidalgo's RBI single in the first extended his career-high hitting streak to 15 games. Mitch Meluskey also had an RBI single, giving the Astros a 2-0 lead in the opening inning.
Hernandez settled down after that and permitted only one more runner to reach second base. He struck out seven and allowed seven hits.
''He (Hernandez) threw everything up in the zone and he was hitting his spots,'' Astros third baseman Chris Truby said. ''We never really got any good pitches to hit. He throws 86 miles per hour but he's free and easy.'' Notes:
Bonds has passed Stan Musial, Willie Stargell, Dave Winfield and Carl Yastrzemski on the career homer list this season. ... Jeff Bagwell and Hidalgo are the second Astros duo to hit at least 30 homers in the same season. Moises Alou (38) and Bagwell (34) did it in 1998.