From: Sidney Poitier, The Measure of a Man: A Spiritual Autobiography, HarperCollins Publishers: New York, NY (2000), pages 252-253:
Years ago I had the privilege of getting to know Carl Sagan... Despite his background as a serious scientist, despite all the physics and math he knew, Sagan still had the great capacity to wonder... He maintained that sense of wonder throughout his life... he became ill... He went on Nightline, I remember, and he talked about his work... a question came up about illness and hope. It was phrased as delicately as possible, but the gist of it was, "What are the thoughts of a dying man, and what exactly comes to mind in terms of religion and the afterlife?"
Carl was a scientist to the end (not that there aren't scientists who believe in God). He let it be known that his faith was firmly in science and that he believed science would eventually explain much, much more than we know now, and that those forthcoming technical details would be the only answers we're ever going to have. In other words, he wasn't looking for a hedge in his time of need. He wasn't covering his bets.