Cormac McCarthy dedicated The Road to John Francis McCarthy - his son. In 2007 on the Oprah Winfrey show, he spoke about how he got the idea for the novel while staying in an El Paso motel with then 4-year old young son - imagining the world outside destroyed in a cataclysmic event.
The cataclysm - the event that changed the world remains unnamed. The toxic air, the poisoned environment, the withered flora and fauna all point to some sort of man-made disaster like total nuclear war. The road is a wasteland. The unnamed father and son and everyone and everything they encounter make up this waste. They survive by scavenging through stores, homes, shelters and trash, and carry what they can use later in a cart. They hide whenever they see signs of life, mainly out of fear of cannibals. The absolute fear of cannibals manifests through the father's most guarded possession - a gun he plans to use on his son to save the boy if ever they are in danger of falling into the hands of cannibals.
The story is bleak and emotional, and entirely based on the father-son relationship; it speculates on how a father would react to the immediate and deadly dangers in a post apocalyptic world. It also shows how the innocence and inherent goodness of children can affect adults in that cruel world. The father introduces morality to the son; he tells the boy that they are the 'good guys', and that they're carrying 'the fire'. He also slips in the real world saying that they have to avoid the bad guys at all costs. There are many times when the imminent dangers of the real world brutally suppress the morality of the child, and give the boy cruel lessons in survival. The father is unable to show the boy how they are the 'good guys' - all he can offer is words of hope and reassurance.
The boy gives purpose to his father, and the father in turn gives him hope; those are the only uplifting parts of the book. Everything else that happens which isn't bad just provides a sense of relief.