ST. PETERSBURG, Fla. — Another one of those helmet-ejecting swings sent Hanley Ramirez twirling to his knees yesterday.

Ramirez injured himself on the gigantic sixth-inning hack, received a visit from the trainer and then finished the at-bat with a flyout to right field. He remained in the game to play defense at first base through the seventh before he left the Red Sox’ 4-0 loss to the Tampa Bay Rays with right side soreness.

In the eighth, Travis Shaw shifted from third base to first, with Marco Hernandez taking over at the hot corner. In his lone at-bat in the ninth, Hernandez struck out as the No. 5 hitter behind David Ortiz.

“Side got really tight,” Ramirez said. “I talked to (manager) John (Farrell) and we’re just trying to prevent something big. He told me that we’re not going to put your season on the line. Take care of that and be ready to go (tomorrow, when the Sox play at home against the Los Angeles Angels).”

Ramirez was hurt swinging through a 94-mph fastball “just trying to hit a grand salami,” he said.

About the following swing, when he flew out on a 2-1 pitch, Ramirez said, “I was a little bit scared to swing. I was like, ‘I don’t want to take any risks.’ ”

Despite an 0-for-3 in the series finale, Ramirez is hitting .286 with four homers over his last 15 games.

Prior to that, he hit .186 during a 24-game homerless drought.

“I’ve been seeing the ball better,” he said. “I’ve been waiting for that moment. I kept working and finally it came.”

Ortiz slows

Ortiz appears to be slowing down. Fortunately for the Red Sox, they’ve never relied on the designated hitter’s speed.

Farrell said he’s noticed the obvious, that Ortiz has been running much slower recently compared to the moderate speed he showed on the basepaths early in the season. The 40-year-old has been jogging especially slowly out of the batter’s box on grounders and hasn’t been pushing himself too hard from base to base.

“There have been some times where it’s maybe not been what we saw early in the season,” Farrell said. “The one thing is, we’ve charted the total bases to date and particularly it’s the doubles, the two-base running, that really taxes him.”

Ortiz went 1-for-4 (ninth-inning single) with four runners left on base in the loss. It was his 66th start in 78 games, and the Sox have routinely rested him about once a week due to ongoing soreness in his feet, ankles and heels.

“We know this will be an ongoing maintenance situation,” Farrell said.

While Ortiz, hitting .336 with a 1.103 OPS, is almost certainly going to make the All-Star team, the Red Sox are hoping he limits his action during the festivities. Ortiz told WEEI.com that he would not participate in the Home Run Derby.

“He’s having a hell of a year,” Farrell said. “If it turns out he doesn’t participate in the Home Run Derby, I think that’s probably music to all of our ears. But at the same time, he’s earned the right to enjoy and experience that opportunity in San Diego as much as anyone.”

Hole in rotation

The Red Sox aren’t yet saying who will replace Eduardo Rodriguez in the starting rotation after he was sent to Triple-A Pawtucket following Monday’s loss, but Farrell has declared when it will happen. Utilizing today’s off day to give the starters an extra day of rest, Farrell will deploy a new fifth starter on Sunday in the series finale against the Angels.

Farrell said Tuesday that the schedule of available pitchers in Pawtucket would factor into the decision. That could signal the major league debut of Aaron Wilkerson, a 27-year-old right-hander who was pitching in an independent league as recently as 2014.

Since his promotion from Double-A Portland to Pawtucket, Wilkerson has a 2.20 ERA with 49 strikeouts to just 10 walks in 41 innings. Like Rodriguez, Wilkerson also pitched Monday and would go on regular rest on Sunday.

The Red Sox have few other options. Roenis Elias was on the mound for Pawtucket yesterday, making him unavailable for Sunday, while Henry Owens, who is walking 6.2 batters per nine innings this season, is scheduled to pitch for the PawSox tomorrow night.

Holt close; Young not

While the Red Sox expect to get one of their injured position players in utility man Brock Holt (concussion) back from the disabled list tomorrow night, there was some grim news on another of the injured. The results of Monday’s MRI on outfielder Chris Young’s injured hamstring were not good.

“(The MRI revealed) probably, maybe a little bit more injury to the hamstring than the physical exam in the training room,” Farrell said. “What that means in terms of duration for the DL at this point is still unknown.”

Holt started the season as the left fielder and was replaced primarily by Young while on the DL.

During an eight-game rehab assignment with Pawtucket, Holt went 8-for-25 with two doubles, five walks and five strikeouts. However, he was still experiencing concussion-related issues.