BOSTON — Pitching, patience and the Atlanta Braves are bringing the Boston Red Sox back from their longest losing streak in 20 years.

The defending World Series champions hope three straight wins after 10 consecutive losses are just the start of a resurgence.

John Lackey pitched into the seventh inning Wednesday night and the Red Sox beat the Braves for the third straight day, 4-0.

“We’re not looking too far ahead,” Lackey said. “You can’t make up 10 games in one day. You’ve just got to keep grinding.”

On Tuesday night, the Red Sox won 6-3 in Atlanta as Jon Lester allowed three runs in six innings and broke a two-game personal losing streak.

Lackey (6-3) got his turn and kept his stingy season going, giving up eight hits and no walks, striking out nine in 61/3 innings. He has permitted two runs or fewer in eight of his 12 starts.

“I’m going out there and trying to compete, trying to pitch the best I can every five days regardless of what’s going on,” Lackey said. “As a starter, you only get 30-something chances a year, so you’ve got to respect those and take advantage of them.”

Jackie Bradley Jr., A.J. Pierzynski and Jonny Gomes each had two hits and an RBI as the Red Sox extended their mastery over the Braves. Boston is 18-6 since 2005 against Atlanta.

Lackey’s performance, “on the heels of what we’ve come off of (was) much needed,” Boston Manager John Farrell said. “When you look at the last two nights, both John Lackey and Jon Lester have done an excellent job of getting deep in the game.”

Lackey combined with three relievers for Boston’s first shutout of the season. He allowed more than one runner in just two innings and just one past second.

“If you throw strikes, you have a tendency to get any hitters aggressive and you can expand” the strike zone, Atlanta Manager Fredi Gonzalez said. “We got nine hits, left all kinds of people on base. We just couldn’t get that next one.”

Gavin Floyd (0-2) gave up two runs in five innings and took his first career loss against the Red Sox after seven wins. He is 3-1 at Fenway Park.

Boston went ahead 1-0 in the second inning when Gomes led off with a single and kept going to second on a throwing error by shortstop Ramiro Pena.

“You just have to look past those things when those things happen and hope things will turn around,” Floyd said.

They didn’t.

Gomes took third on a wild pitch before Grady Sizemore walked, and scored when Daniel Nava grounded into a double play.

The Red Sox added a run in the third on a double by Xander Bogaerts, one of his three hits, and singles by David Ortiz and Pierzynski.

Boston made it 3-0 in the sixth against Alex Wood when Gomes walked, took second on a single by Sizemore and scored on a double by Bradley.

The Red Sox reached Wood for another run in the seventh on an RBI single by Gomes.

In each of his first six innings, Lackey had at least one strikeout and didn’t allow a runner past second. He retired the first hitter in the seventh, then allowed singles to Tommy La Stella and Pena that put runners at first and third.

Lackey left after throwing 105 pitches. Chris Capuano retired Jason Heyward on a groundout as the runners advanced to second and third. Heyward’s bat broke and Capuano fell on his back as he just avoided being hit by a broke piece.

Capuano walked B.J. Upton, loading the bases, before getting Freddie Freeman to end the threat with a grounder.