The hit musical comedy drama will end next season and the series finale will honour the late Cory Monteith.
Ryan said the death of Cory, who played high-school quarterback Finn Hudson, had forced him to change how the show would end.
He explained that the final season was originally meant to tie up the on-off romance between Finn and Rachel, played by Cory's real life girlfriend Lea Michele.
Speaking at a Paley Centre event honouring FX Networks on Wednesday night (17 October), Ryan said "The final year of the show, which will be next year, was designed around Rachel and Cory/Finn's story.
"I always knew that, I always knew how it would end. I knew what the last shot was – he was in it. I knew what the last line was – she said it to him.
"So when a tragedy like that happens you sort of have to pause and figure out what you want to do, so we're figuring that out now."
He continued: "I have a good idea. I'm going to tell the studio and the network [in a week] how after Cory's unfortunate passing we can end the show that I think is very satisfactory. And kind of in his honour, which I love."
Cory, 31, was found dead in Vancouver, Canada, in a hotel room on 13 July 2013. A coroners report revealed that Cory's death was accidental, resulting from intravenous heroin use combined with alcohol.
Glee is currently on a hiatus after airing a tribute episode to Cory, which was shown in the US last week. The tribute episode, titled The Quarterback, showed the McKinley High family join together to remember the life of Finn.
The episode will air in the UK tomorrow (18 October) at 8pm on Sky1. Meanwhile, season five of Glee will resume on 7 November in the US.