DENVER (AP) -- Five solid innings by rookie pitcher Chad Bettis couldn't make up for a rough opening.
Hunter Pence and Pablo Sandoval hit back-to-back homers off Bettis in the first inning and Yusmeiro Petit won his first game in four years, helping the San Francisco Giants beat the Colorado Rockies 5-3 on Tuesday night.
"He gave up two homers in the first, but he did a nice job after that," Rockies manager Walt Weiss of Bettis. "He kept the Giants in check after that. He did his job."
The successive homers by Pence and Sandoval marked the first time all season the Giants have hit back-to-back homers.
Pence's shot came with Brandon Belt on board with the first of his four hits, and sailed beyond the left field bleachers before smacking onto the concourse. Bettis said he threw him a fastball on the inside part of the plate.
"The ball was on the chalk inside," Bettis said. "He knew it was coming in and he cheated to it and I mean you've got to tip your hat to him. I probably should have thrown a different pitch there. But you can go back now and always say that. It's incredible that he got to it still, but he did."
Petit (1-0) was recently called up from Triple-A Fresno to fill in for Matt Cain, who was placed on the 15-day disabled list last week with a bruised right forearm.
Petit lasted six innings, allowed six hits and two runs. He also struck out six.
Sergio Romo pitched a perfect ninth to pick up his 32nd save in 36 chances.
Bettis (0-3) allowed four runs and nine hits over six innings. Bettis, who didn't pitch last season after hurting his right shoulder, is still searching for his first major league victory.
"I've seen some good things with Chad," Weiss said. "It's just with young pitchers, young players, finding that consistency.
"In Chad's case, it's keeping the ball off the middle of the plate, especially off-speed stuff. But I like the way he regrouped and settled in. His makeup is pretty good. He handles himself really well."
Bettis said that he never really felt sharp during his outing.
"I felt like from the get-go, I didn't have my best stuff. I felt like I was up in the zone. I know what I need to do to work on that and get back down. Other than that, it was a rough one."
Troy Tulowitzki returned to the lineup for the Rockies after sitting out the past two games with a sore oblique. The smooth-fielding shortstop finished 1 for 3 with a run scored. The Rockies were without Dexter Fowler, who sat out with a bruised knee.
Given his roots as a reliever, Petit pitched out of the stretch even with no one on base.
He also pitched his way out of trouble on several occasions as he earned his first major league win since beating the Giants on Aug. 27, 2009, as a member of the Arizona Diamondbacks.
In the fourth, Petit loaded the bases with two outs, only to wiggle out of the jam by fanning Bettis with a low slider.
An inning earlier, Petit struck out Corey Dickerson and enticed DJ LeMahieu to fly out to strand a runner at third.
Just that kind of night for the Rockies, who finished 1 for 10 with runners in scoring position.
Pence put the Giants on the board early when he hit a two-run homer that cleared the top row of seats in left. Three pitches later, Sandoval lined a slider over the fence in center.
Before the game, Carlos Gonzalez provided some fireworks as he launched several pitches into the upper deck during batting practice. This with an injured middle right finger, too.
Gonzalez said his dinged-up digit is feeling better and hopes to soon leave for a rehab assignment. The All-Star has been on the disabled list since early August.
"It's something I can play through right now," Gonzalez said.
NOTES: The Rockies activated C Yorvit Torrealba (concussion) from the seven-day disabled list. To make room, the team optioned utility player Ryan Wheeler to Triple-A Colorado Springs. ... The Rockies will send Jhoulys Chacin (12-7) to the mound on Wednesday, while the Giants counter with Madison Bumgarner (11-8).