The great tragedy of CS Lewis’s life was the loss of his wife, Joy Davidman, to cancer in 1960. Her death tested the faith of the Chronicles of Narnia author, who was also a prominent Christian thinker.

Now a cache of previously unpublished letters from Lewis, written in the months before his own death, reveal the extent to which his grief remained raw, even as he confronted his own physical decline and mortality.

In a 1963 letter to American scientist Thomas Van Osdall, with whom he struck up a correspondence late in life, the author wrote of his sadness to learn that Van Osdall’s only child, Thomas, had been killed in a car crash at the age of 18, in 1962.

Lewis, recalling his own grief at his wife’s death, wrote: “You tell a most moving story. I too have lost what I most loved. Indeed unless we die young ourselves, we mostly do. We must die before them or see them die before us. And when we wish – and how agonizingly we do, o how perpetually! – it is entirely for ourselves, for our sakes not theirs.”

Joy Davidman, an American poet, married CS Lewis in 1956. Photograph: Gado Images/Alamy Stock Photo

Davidman, as a young poet and fan living in New York state, began writing to Lewis in 1950. They married in 1956. When she died of bone cancer, Lewis wrote A Grief Observed, his classic 1961 work on mourning and how faith can survive it. The book helped inspire a TV movie and stage play, Shadowlands, and an Oscar-nominated 1993 film of the same name, starring Anthony Hopkins and Debra Winger.

The new letters – two by Van Osdall and three by Lewis, some of the last he ever wrote – show that the questions that vexed Lewis then continued to dominate his thoughts to the end. The letters are dated between 27 May and 26 October 1963. Lewis died just weeks later, on 22 November, and the letters give a sense of how he spent his final days.

Although he had invited Van Osdall, professor of chemistry at Ashland University, Ohio, to visit him in Britain, he had also told him of his serious physical decline: “My life has undergone a great change,” he wrote. “I nearly died in July and I have now resigned all my appointments and live on one floor of this house as an invalid.”

Van Osdall died in 2001 and the letters were found several years later and given to his university, which passed them on to Michael Peterson, professor of philosophy at Asbury Theological Seminary in Kentucky.

Peterson realised the significance of the correspondence as soon as he saw it, he told the Observer: “The university called me to assess the letters and gave me permission to be the first to expose these to the Lewis fan base and to the world.”

Just to see the handwriting, you get a sense of Lewis’s personality. He was a very intense but warm person Michael Peterson

He will publish them in his forthcoming book, CS Lewis and the Christian Worldview, to be released by Oxford University Press next month.

Peterson said: “There are three volumes of Lewis’s letters out there – and now five others show up. Just to see the handwriting, you get a little sense of … Lewis’s personality. He was a very intense but warm person. That comes across.”

Between 1954 and 1963, Lewis was professor of medieval and Renaissance English at the University of Cambridge. Although best known for his children’s fantasy classic The Lion, the Witch and the Wardrobe, he also wrote extensively on science and its relation to Christian faith and general culture.

His faith was tested after Davidman’s death, but Peterson argues that his beliefs held strong. His theological questions about her suffering and death drove him to understand his rational faith “a bit differently intellectually”, he said. “One of these letters shows his faith wasn’t destroyed. He was speaking out of the framework of faith.”

The correspondence between Van Osdall and Lewis sprang up when the scientist wrote for advice on a planned book about science and Christian faith. As fellow academics and devout Christians, the two men went on to explore their mutual interest in science and theology before finding themselves sharing private thoughts on the death of loved ones.

In his letters, Van Osdall posed the question: “Can it be that science and theology are actually traveling the same road and that someday both will meet?”

Tilda Swinton in the film of The Lion, the Witch and the Wardrobe (2005). Photograph: Phil Bray/Ronald Grant

Quoting from Lewis’s 1947 book Miracles – “Men became scientific because they expected Law in nature” – the American asked: “Is your concern, at this point, with the problems of uncertainty, wave and particle dilemma, probability and free will?”

Lewis, with typical modesty, replied: “I am flattered that you should wish to use my rather amateurish remarks… When I spoke about the hypothesis of a lawless ‘subnature’ I certainly had in mind ‘uncertainty wave – and particle dilemma,’ not free will…

“Of course you’ll ‘run into trouble’, but so you will, surely, in any work worth writing.”