Gray, the third overall pick in the 2013 draft, was penciled into a rotation spot. When Jonathan Lucroy tapped Gray's 97 mph fastball to the mound for a likely double play, Gray threw it high and wide of second base, and a run scored.
Manager Walt Weiss and the training staff came out to check on Gray, who was quickly removed after 16 pitches.
Gray, 24, was to undergo an MRI.
"He said he was feeling it on certain pitches," Weiss said. "When you hear that you just take him out."
It was Gray's fifth appearance and third start of the spring. He made nine starts with an innings restriction in his big league debut over the final two months of last season.
"Anytime you're dealing with an injury it's not ideal," Weiss said, "but it could be worse."
Information from The Associated Press was used in this report.