It was as raw as it was probably loud and the outburst by CC Sabathia robbed him of focus and cost him dearly.

Fuming about a check-swing single that beat the shift by David Ortiz in the sixth inning, the Yankees’ ace let it affect him.

“I was [ticked] and mad and made a bad pitch,’’ Sabathia said after old friend Grady Sizemore’s three-run homer was enough for the Red Sox to hang a 4-2 loss on the Yankees in front of 44,121 at Yankee Stadium on Friday night. “Then I was 3-0 on [Mike] Napoli before I calmed down.’’

Napoli hit a ground single to center to put runners on first and second with one out for Sizemore, a former teammate of Sabathia’s with the Indians.

At 0-1 Sabathia wanted to get Sizemore to roll over and hit a ground ball that hopefully would have started an inning-ending double play. Instead Sizemore connected and the misbehaving slider landed in the right-field seats for a three-run homer that turned a 1-1 game into a 4-1 Red Sox lead.

“I tried to get him to hit something weak. They had two slow runners on,’’ Sabathia said of the fatal pitch to Sizemore. “I was hoping for the double play.’’

As has been the case in each of his three starts, Sabathia threw the ball well for most of his innings. But as in the other two outings, there was one inning that bit him. In addition to Sizemore’s blast, Sabathia gave up a leadoff homer in the sixth to Jonny Gomes, but that didn’t tick him off.

“Fastball down and away,’’ Sabathia said of the pitch Gomes hit over the wall in left-center. “I am not too upset over that.’’

While walking off the mound following the four-run inning, Sabathia covered his mouth and screamed into the cool spring evening. He was blowing off steam, but admitted his emotions cost him long before he got the third out.

“Any time you see me yelling, it’s frustration on my part,’’ said Sabathia (1-2), who allowed four runs, six hits, walked two and fanned nine in seven innings. “As I have gotten older I have controlled my emotions. Tonight they got the best of me.’’

So, too, did fellow lefty Jon Lester, who entered the game 0-2 despite having a 2.51 ERA.

“Lester pitched great,’’ said Kelly Johnson, whose two-out single scored Ichiro Suzuki from second in the seventh, cut the deficit to 4-2 and ended Lester’s night.

In 6 ²/₃ innings, Lester allowed two runs, six hits, walked two and whiffed six. Junichi Tazawa surfaced to retire Derek Jeter for the final out of the eighth. With Koji Uehara unavailable due to shoulder stiffness that surfaced while the all-world closer was long-tossing, Edward Mujica recorded the final three outs for the save.

As he has been in all three starts, Sabathia found enough positives to believe he is a long way ahead of where he was a year ago.

“My stuff is there,’’ said Sabathia, who was able to locate his 90-mph fastball well. “I feel confident and good. I just have to put a whole game together.’’

Two runs isn’t enough for most pitchers to win. And when the pitcher makes a brutal pitch, the price is steep.