I believe that this novel ends with a sense of hope and brightness. The boy coming across a real family that was willing to take him in was a beacon of luck and light in his thus far very dreary and difficult existence. The fact that there is a family out there that is still together, that is willing to take yet another person into it, confirms what the father had been trying to teach the boy the entire time, that "the fire" is still alive and well in some human hearts, despite the brutality and misery that existed all around them. Overall, the book is incredibly depressing and anxious, fraught with near-death and the ugliest sides of human nature. However, the recurring theme of human goodness being alive in the boy and the father, in love, decency and compassion, runs throughout the story, and flares again at the end.
If the father had died and the boy had been all alone, that would have truly been a tale of despair, and a commentary on the lack of any redemption in human nature. However, that is not how McCarthy, who once called the writing of this book "a love story to my son," chose to end it. He gave us a small glimmer of happiness, of normalcy, of a potential for human goodness to thrive and find a place in the ashen world where human hopes and civilization was nearing extinction. I hope that those thoughts helped; good luck!
I fully agree with mrs-campbell's answer. I want to add that one detail at the end of the novel (every reader will probably focus on different details, of course) makes me have hope for the young boy at the story's end. The man with the rifle who appears at the novel's end and promises to take care of the boy -- and to make him part of the family that mrs-campbell refers to -- proves his trustworthiness when he keeps his promise to wrap the dead father in a sheet. The boy doesn't witness this act of kindness, but when the boy go to spend a few final moments with his father's body, he does see (and, through him, the reader learns) that the man with the rifle is one who keeps his word. The man also uses language that resembles the words of the boy's father. These details may give this reader a sense of real hope.