SAN FRANCISCO (AP) -- The sting in his leg was secondary. When a sharp comebacker by Buster Posey ricocheted off Chase Anderson's right calf, Arizona's starter just hoped someone would get to the ball in time to make a play.
Instead, the right-hander lost his no-hit bid when he got hit in Arizona's 1-0 victory against the San Francisco Giants on Friday night, which ended a four-game losing streak.
"I was just hoping it would go to someone so we could get him out," Anderson said. "It hit me, it just felt tight. I was just like, 'I'm not coming out of the game, obviously.' It wasn't that bad."
Anderson grimaced in pain as the ball rolled toward the third-base line, leaving the Diamondbacks without a play on Posey's infield single. But the right-hander finished the inning and outpitched World Series MVP Madison Bumgarner as the Giants lost their sixth straight home game.
"I was kind of looking for it. I looked over and it looked too far away — he's going to beat that out," Anderson said. "I wish it would have went to somebody."
Anderson (2-1) struck out two, walked one and plunked No. 7 hitter Matt Duffy twice before giving way to Daniel Hudson in the eighth.
Backed by Ender Inciarte's second-inning RBI single, Anderson snapped a three-start winless stretch since his previous victory May 20 at Miami. He said he might have had a slight advantage facing the Giants for the first time.
"I was amazed that he hadn't faced them," manager Chip Hale said. "You could see him with a good focus out there, taking deep breaths, just concentrating on every pitch. To win 1-0 against the world champs is a feather in our hat."
Arizona didn't allow a runner past second and held on while outhitting San Francisco 11-2.
Three days after rookie Chris Heston pitched a no-hitter against the Mets in New York, the Giants were on the other end of a no-hit bid for much of the night.
Joe Panik had his career-best 15-game hitting streak snapped.
Bumgarner (7-3) allowed nine hits for his second-highest total of the season but lost for only the second time in his last 12 starts against Arizona. He struck out seven and walked three in eight innings, losing for the first time in six starts overall.
Bumgarner traveled back with the team on the overnight flight from New York despite manager Bruce Bochy and pitching coach Dave Righetti advising him to travel ahead of time. The team landed about 4:30 a.m. and reported later than usual to the ballpark Friday afternoon.
"He's hard-headed," Bochy said of his ace left-hander.
Bumgarner — no surprise — insisted he was unfazed.
"I got plenty of sleep and felt rested. My stuff was good," he said. "They keep hitting to where we weren't."
Duffy hit a leadoff single against Hudson in the eighth and advanced on a wild pitch. He was tagged out at third in a rundown after pinch-hitter Casey McGehee's grounder.
Brad Ziegler worked a perfect ninth for his seventh save as the Diamondbacks won for the fourth time in the last five against San Francisco.
Giants left fielder Nori Aoki threw out Paul Goldschmidt at the plate to end the third.
Aoki lined to Aaron Hill at third base for an inning-ending double play in the bottom half.
"That's just a reaction, that happened so fast," Hill said. "It worked out. That was probably a double down the line."
The Giants' home skid is their longest since dropping seven in a row in May 2008.
Bochy reiterated again how frustrated he is that the Giants had to play a night game at the Mets on Thursday before flying cross-country. He hopes the players' union will take a stand regarding the schedule.
The Giants annually have among the highest total of air miles traveled.
"I think we're dropping the ball here," Bochy said, noting the risk for injury. "Hopefully we'll fix this. I certainly don't think ticket sales should play a part in it."
Giants: RF Hunter Pence was placed on the 15-day disabled list with tendinitis in his left wrist, a move retroactive to June 3. He was scheduled to be re-evaluated by team doctors. ... OF Gregor Blanco's dizziness is subsiding from a concussion that has sidelined him since Wednesday.
Diamondbacks: After the game, Arizona announced RHP Josh Collmenter is being moved to the bullpen and RHP Allen Webster will be called up from Triple-A Reno to pitch Saturday against San Francisco. Collmenter (3-6) originally was scheduled to start the game.
Giants: RHP Ryan Vogelsong (4-4) looks for his first win against Arizona this year and just the fourth of his career in 17 starts.