The main theme of "Elegy Written in a Country Churchyard" is the inevitability of death. This is a poem that expresses the sentiment known as memento mori: a reminder of our own mortality.
The scene is of a country churchyard with a graveyard. There are many symbols that relate to death: the curfew "tolls," the day is "parting, and "all the air a solemn stillness holds." Graves are noted as "narrow cell(s)" and "lowly bed(s)." The speaker goes on describing what the dead used to do. Then he stresses that these things no longer occur. There is a sense of the irretrievable past.
Beginning around the 9th stanza, the speaker adds that death is a fate to all, no matter how rich or poor one might have been:
The boast of heraldry, the pomp of power,
And all that beauty, all that wealth e'er gave,
Awaits alike the inevitable hour.
The paths of glory lead but to the grave.
The speaker also wonders about the dead. Who were they? What inspired them? "Full many a flower is born to blush unseen, / And waste its sweetness on the desert air." Lying in these graves might be someone like the great writer John Milton or the leader Cromwell. The speaker adds that the dead, regardless of their station in life, deserve respect. He says this because it is right and moralistic, but also because he will be dead some day as well. He then wonders if another solitary person will think of him while strolling through the graveyard: "If chance, by lonely contemplation led, / Some kindred spirit shall inquire thy fate."
Gray (the speaker) imagines this person (presumably an old farmer - "hoary-headed swain") commenting upon Grays' life. This begins at line 98. The old farmer remembers that Gray was a wanderer, "forlorn," "or crossed in hopeless love." This is a fitting description of Gray, a solemn, meditative poet.
The poem is about becoming aware of, and meditating upon, death. In contemplating the deaths of others, Gray then imagines his own death. It all seems quite pessimistic, but one of the effects of a memento mori poem is that, in acknowledging death, one can then decide to make the most of life, to make the best of the time that is given to us.