Boston Red Sox’s J.D. Martinez, right, celebrates a three-run home run against the Chicago White Sox with teammate Xander Bogaerts during the ninth inning Thursday, Aug. 30, 2018, in Chicago. (AP Photo/Jim Young)

CHICAGO — Even when they are down, the Boston Red Sox are one confident bunch.

Jackie Bradley Jr. and company always think they have plenty of time.

Bradley hit a sacrifice fly in Boston’s four-run seventh inning and a tiebreaking single in the ninth, helping the Red Sox beat the Chicago White Sox 9-4 on Thursday night.

“It takes 27 outs and you have to grind it out against us,” manager Alex Cora said.

Boston (93-42) earned its third straight win and increased its AL East advantage to 8 1/2 games over the New York Yankees, who blew a late lead in an 8-7 loss to Detroit. The Red Sox trailed late in the game each of the last three days — and won each time.

“We know we can do it, so there’s no lack of energy or confidence,” Bradley said. “We know we just got to buckle down and get the job done, execute.”

Ian Kinsler sparked the winning rally against Chicago with a one-out single off Thyago Vieira (1-1) for the last of his three hits. Blake Swihart then walked before Bradley drove in Kinsler with a liner into right field.

The big league-best Red Sox poured it on from there. Andrew Benintendi added another RBI single and J.D. Martinez hit a three-run drive for his 39th homer, making it 9-4 and sending much of the crowd of 18,015 to the exits.

Mookie Betts also homered for Boston, and Ryan Brasier (1-0) pitched a perfect eighth for his first win in his 28th major league appearance.

“We kind of stole one today,” Betts said, “and just showed you have to shut us down for all nine innings. It’s not just half of the game.”

Chicago (53-81) wasted a terrific start by Lucas Giolito, who struck out eight while pitching 6 1/3 innings of one-run ball. Avisail Garcia homered and drove in three runs, and Yolmer Sanchez collected three hits in the opener of a 10-game homestand.

Giolito “just continues to settle down and pitch very, very well,” White Sox manager Rick Renteria said. “He’s executing very well. He did a great job.”

The White Sox had won five of six, including two of three in their previous series against the Yankees. But they were unable to put away the powerful Red Sox, who scored 11 times in the seventh inning of a 14-6 victory against Miami on Wednesday night.

Chicago got off to a fast start behind Garcia, who is batting just .159 (17 for 107) with 37 strikeouts in 28 games in August. Garcia hit a two-run drive to center in the first and a sacrifice fly in the second, helping the White Sox build a 4-0 lead against Rick Porcello.

Giolito threw a career-high 113 pitches before he was pulled after Brock Holt walked in the seventh. The 6-foot-6 right-hander got a big ovation as he made his way to the dugout, but the cheers quickly faded as the Red Sox pounced on Jeanmar Gomez.

Kinsler and Swihart greeted Gomez with consecutive singles, driving in Holt for Boston’s first run. Bradley then hit a sacrifice fly before Betts connected for his 29th homer, tying it at 4 with a towering drive just over the wall in left.

GOING QUITE WELL

Giolito’s eight strikeouts matched his season high. He is 3-0 with a 2.84 ERA in his last four starts.

“I’m very confident in myself. I always have been,” he said.

TRAINER’S ROOM

Red Sox: LHP David Price visited a hand specialist after he was hit on his left wrist by a line drive in the third inning of Wednesday night’s 14-6 win against Miami. Cora said Price is OK, but he doesn’t know if he’ll take his turn in the rotation next week in Atlanta. … LHP Chris Sale (shoulder inflammation) played catch for the fourth straight day. … Cora said 1B Mitch Moreland was feeling better after the All-Star missed Wednesday’s victory because of a bruised left knee. Moreland was out of the lineup again, but was available off the bench.

White Sox: Manager Rick Renteria said RHP Reynaldo Lopez was fine a day after he lacked his usual velocity at the beginning of his start against the Yankees. Lopez started to throw harder as he got deeper into his outing. “He felt like he had slept on his arm wrong or something,” Renteria said. “It took him a couple of innings to loosen up.”

UP NEXT

White Sox right-hander Michael Kopech makes his third major league start Friday night against right-hander Nathan Eovaldi and the Red Sox. Kopech (1-0, 1.13 ERA) was one of Boston’s top prospects before he was traded to Chicago in the Sale deal in December 2016. Eovaldi (5-6, 4.15 ERA) has dropped his last two starts.