The following quote from A Grief Observed perhaps helps understand how C.S. Lewis slowly comes to terms with his emotions following the horrible death of his wife, Joy.
God has not been trying an experiment on my faith or love in order to find out their quality. He knew it already. It was I who didn't.
In this collection of personal recollections, Lewis describes how the loss of a loved one is like "an amputation"; the pain does not go away, you remember the loss daily, and the fact that change is expected and obligated to happen (whether willfully or against our will) makes the loss all the more powerful in our lives. If the loss is particularly unfair, such as his wife's who died suddenly of terminal bone cancer, the "moment" does not cease to repeat itself.
Lewis observes that, in order to understand the plan that God has behind allowing tragedy to touch our doors, he makes us go through every step of grief so that, at the end, we can understand the brevity and the delicate nature of life.
In this trial He makes us occupy the dock, the witness box, and the bench all at once. He always knew that my temple was a house of cards. His only way of making me realize the fact was to knock it down.
He is emphatic that he does not rebel against God, but mainly tries very hard to go through a process so complex and sensitive that the only way to embrace, recognize, and understand it is through roughing into it, no matter how painful it is.
So emphatic he is about the fact that he does not rebel, that he explains the difference between questioning God and accepting every human advice made in the name of religion at face value; only those who have been in a situation of grief can truly counsel others. Only God knows really what is in our hearts. But it is quite different when someone with no idea of how painful it is comes to tell how you to feel or think based on one or two scriptures or on religious fanaticism. That, he does rebel against.
Talk to me about the truth of religion and I'll listen gladly. Talk to me about the duty of religion and I'll listen submissively. But don't come talking to me about the consolations of religion or I shall suspect that you don't understand.
Yet, Lewis does allow himself room for venting, even though he does not want directly to show ire against God for what happened. He allows it because he knows that, in the end, he is still a human being and he is not perfect. Moreover, God would either understand or forgive whatever argument of anger Lewis raises toward Him.
Not that I am (I think) in much danger of ceasing to believe in God. The real danger is of coming to believe such dreadful things about Him. The conclusion I dread is not 'So there's no God after all,' but 'So this is what God's really like. Deceive yourself no longer.'
Keep in mind that this is not a linear story, nor a sequentially correct narrative; as "reflection" Lewis has the right to contradict himself, sound happy in some ocasions and more sad in others; he has literary license to say whatever he wants, because the ultimate purpose is to come to terms with his loss. This is why his views on God or religion may sound sometimes ambivalent. However, it is undeniable that he maintains his faith, and does depend on the idea of God's mercy as a way to heal.