BOSTON -- Sonny Gray does not believe this is the end.

When Gray arrived at Fenway Park on Thursday afternoon before the Yankees' opener of a four-game series against the Red Sox, manager Aaron Boone told the righty that he was moving him out of the starting rotation and into the bullpen. Boone made the decision on Wednesday night after Gray gave up seven runs over just 2 2/3 innings in the Yankees' 7-5 loss to the Orioles. Lance Lynn , who was acquired from the Twins on Monday, will move into the starting rotation.

"I don't think my days as a starting pitcher in this league are over," Gray said. "I think in this moment, right now, I think the thought is to have me go to the bullpen and see what happens. ... Whether it's this year or next year or down the road, I truly envision myself as a starter in this league."

Boone left Gray's status as a bullpen pitcher open-ended. He said anything from injuries to improved command could help Gray return to the rotation.

Gray, who is 8-8 with a 5.56 ERA in 21 starts this season, said his greatest struggle under the Yankees' spotlight has been consistency. Boone sees potential in Gray to be a solid starter, but right now, his struggles with length swayed Boone to switch Gray's role to a reliever.

"The stuff that we see really each outing would suggest that he is more than capable," Boone said. "I think he's just had a hard time being consistent with that and really commanding his fastball at a level that makes you a really good starter in this league. ... Even in the starts where he's struggled, he's had moments in those starts where if you ask opposing hitters, I'm sure they say, 'Man, this guy's nasty.' It's just the command hasn't been there routinely."

Boone said the Yankees' acquisition of Lynn gave them the flexibility to put Gray in the bullpen. Lynn relieved Gray on Wednesday and held the Orioles scoreless over 4 1/3 innings with five strikeouts.

For now, Gray is going to work with other Yankees relievers to come up with a routine for his bullpen preparation; he said the last time he filled this role was for a week with the A's in 2013. He will aim to simplify his approach and improve his consistency.

His goal? To look back on this time as a rough patch.

"I'm going to come in with a positive attitude, I'm going to come in with a smile on my face and I'm going to do whatever I can to help the team win," Gray said. "And right now, that's going to be going down to the bullpen."