Gray was wanted by Bournemouth and Crystal Palace during the summer transfer window, but the Foxes rejected their advances in favour of keeping the England Under-21 international.
Shakespeare is confident that the club are close to wrapping up a new deal for Gray, who moved to the King Power Stadium from Birmingham City in January last year.
Questions have been asked about Gray's potential after scoring just three goals in 61 outings, but the Leicester boss feels that the 21-year-old can follow in the footsteps of the four-time Ballon d'Or winner.
"Remember Cristiano Ronaldo?" Sky Sports News quotes Shakespeare as saying. "When he first came here, people used to criticise him for the same things. With a run of games and experience, that will come.
"If the opposition put two defenders against you and you're trying to beat them all the time, then you have to find another solution. That's what football is all about, finding the right solution for that given moment.
"The contract is in the final instalments, his advisers are talking with our director of football and I'm excepting that to be completed sooner rather than later."
Gray has made five substitute appearances in the Premier League this season.