Facing the slumping San Francisco Giants may be just what he needs to get back on track.
Locke hopes to end a season-worst five-start winless drought and help the visiting Pirates maintain their slim lead in the NL Central on Thursday night in the opener of this four-game series.
The Pirates (74-52) received another strong performance on the mound, but couldn't generate enough offense with only four hits in Wednesday's 2-1 loss in San Diego. The defeat cut their division lead to one game over St. Louis, which beat Milwaukee.
Pittsburgh's starters have a 1.67 ERA in four games since allowing a season-high run total in a 15-5 loss to Arizona on Saturday.
Locke (9-4, 2.90 ERA) had the worst start of his career in that contest, allowing eight runs and 10 hits over 2 2-3 innings.
"Any start like that is a reality check," Locke said following the shortest of his 36 career starts. "You set your standards high, you set your goals high and you're disappointed when you don't reach them."
Locke missed his final turn in the rotation before the All-Star break because of stiffness in his lower back, but has downplayed the idea that he may still be feeling the effects of the injury.
The All-Star, however, hasn't won since July 21 - his first outing following the break. He's 0-2 with a 6.57 ERA with 17 walks in 24 2-3 innings over his last five starts.
While he's 4-2 with a 4.15 ERA in 12 home starts, Locke has pitched much better with a 5-2 record and 1.81 ERA in 12 on the road.
He may be able to continue that success against a San Francisco team that has totaled nine runs and gone 1 for 26 with runners in scoring position while dropping three of four. The Giants (56-70) fell into last place in the NL West following a 12-1 loss to Boston and the Padres' win over the Pirates on Wednesday.
"We're having a hard time with the bats here," manager Bruce Bochy said. "It's got to get better with the pitching side and the hitting side.''
Joaquin Arias was a bright spot in the loss with two hits, including his first home run of the season. Arias went 7 for 14 as San Francisco dropped two of three in Pittsburgh from June 11-13.
Resurgent Matt Cain (8-8, 4.35) takes the mound looking to pitch at least seven innings for a sixth straight start.
Since giving up 11 runs over three innings in consecutive July starts, Cain has gone 3-2 with a 2.41 ERA while limiting opponents to a .193 batting average in his last six.
He's been very successful against the Pirates, going 3-0 with a 1.24 ERA in his last six meetings. He hasn't allowed a run in 15 2-3 innings against them after giving up two hits over 6 2-3 in a 10-0 win at Pittsburgh on June 13.
Andrew McCutchen is batting .441 during an eight-game hitting streak against the Giants and .444 over his last 18 games overall, but is 2 for 16 when facing Cain.
The Giants have won 10 of 14 home meetings against the Pirates.