Updated

This was supposed to be San Diego's blueprint.

The Padres thought the combination of timely hitting, strong starting pitching and one of the best bullpens in the majors, similar to what they had last season when they fell two games short of the NL West title, was their winning formula for 2011.

Chase Headley extended his career-high hitting streak to 15 games with an RBI double and San Diego won three consecutive home games for the first time this season with a 7-2 victory over the Houston Astros on Sunday.

The Padres, who had been awful at home through the first two months of the season, took three in a row from the Astros after dropping the series opener Thursday night. That gave San Diego just its second win in a home series this season. The Padres still have the NL's worst home record at 12-21.

San Diego (27-33) won for the eighth time in 11 games. The Padres remain in last place in the NL West.

"We have been playing a lot better, more like we are capable of playing and how we want to play," said Headley, who had two doubles. "Fortunately, we didn't play bad enough that we played ourselves out of it early. We are still within striking distance. I like the way we're playing."

For as poorly as San Diego has played to this point, it still is only 6½ games behind first-place San Francisco.

"I think on the last road trip, I saw signs of us playing a total game," Padres manager Bud Black said. "I'm seeing the defense tightening up a little bit, I'm seeing the bats swinging better. When those things occur, you're going to have some success."

San Diego scored three first-inning runs to give Mat Latos (4-6) an early lead. Latos labored through five innings to win his third straight start, allowing two runs on six hits with three strikeouts and two walks.

Teammates were quick to credit Jason Bartlett's nine-pitch at-bat as a key to the first inning. He tripled in the first run off rookie Jordan Lyles (0-1).

"It was just a quality at-bat where he fought off some quality pitches," Headley said. "It's nice to see a guy early and see everything he has. When he fought off some pitches, it was beneficial to him and the rest of the guys."

Lyles had a rougher outing than in his major league debut Tuesday when he carried a shutout into the eighth at Wrigley Field.

"Nothing felt really good coming out," Lyles said. "It was a little bit different from that first outing. They made me pay for my mistakes."

The right-hander allowed four runs on five hits in four innings before being lifted. The 20-year-old Lyles struck out three, walked one and hit two batters with pitches.

Houston's Hunter Pence extended his hitting streak to a career-high 17 games with an RBI single in the fifth. Pence's hitting streak is the second-longest current run in the majors. St. Louis infielder Ryan Theriot has hit safely in 19 consecutive games.

After winning the first four games on its road trip, Houston wound up 4-3 for its first winning trip this season.

Alberto Gonzalez had a two-run single for the Padres in the seventh inning, Jason Bartlett had three hits and scored twice, and Ryan Ludwick walked twice, was hit by a pitch and scored two runs.

Following a rough start to the season, Latos is 4-1 with a 2.93 ERA in his last five starts.

San Diego, which has been outscored 36-20 in the first inning, turned around that trend against Lyles.

Chris Denorfia led off with a single and scored on Bartlett's triple. With one out, Lyles hit Ludwick with a pitch and Brad Hawpe followed with an RBI single. Aaron Cunningham bounced into a force play to bring in the third run.

After Latos allowed Michael Bourn's leadoff walk in the third and a stolen base, Carlos Lee followed with a two-out RBI single.

Headley extended his hitting streak with an RBI double to the wall in right-center in the third to score Bartlett, who led off with an infield single, for a 4-1 lead.

Houston got a run back in the fifth on Pence's run-scoring single with one out after consecutive singles by pinch-hitter Angel Sanchez and Bourn.

The Astros, who entered second in the NL in batting average with runners in scoring position, went 5 for 41 (.122) in the series. Houston stranded nine runners on Sunday.

NOTES: San Diego won two of three games against Arizona from May 6-8 for its only other winning series at home. ... Pence's hitting streak is the Astros' longest since Miguel Tejada hit in 21 straight games in 2009. ... Houston RHP Brandon Lyon began a rehab assignment with Triple-A Oklahoma City. Lyon has been on the 15-day DL with right biceps tendinitis and a partial right rotator cuff tear.