It is believed that Gray began writing his masterpiece, the Elegy Written in a Country Churchyard, in the graveyard of St Giles parish church in Stoke Poges, Buckinghamshire, in 1742. After several years of leaving it unfinished, he completed it in 1750 (see Elegy for the form). The poem was a literary sensation when published by Robert Dodsley in February 1751 (see 1751 in poetry). Its reflective, calm and stoic tone was greatly admired, and it was pirated, imitated, quoted and translated into Latin and Greek; it is still one of the most popular and most frequently quoted poems in the English language. In 1759 during the Seven Years War, before the Battle of the Plains of Abraham, British General James Wolfe is said to have recited it to his officers, adding: "Gentlemen, I would rather have written that poem than take Quebec tomorrow".
The Elegy was recognised immediately for its beauty and skill. It contains many phrases which have entered the common English lexicon, either on their own or as quoted in other works. These include:
- "The Paths of Glory"
- "Celestial fire"
- "Some mute inglorious Milton"
- "Far from the Madding Crowd"
- "The unlettered muse"
- "Kindred spirit"
"Elegy" contemplates such themes as death and afterlife. These themes foreshadowed the upcoming Gothic movement. It is suggested that perhaps Gray found inspiration for his poem by visiting the gravesite of his aunt, Mary Antrobus. The aunt was buried at the graveyard by the St. Giles' churchyard, which he and his mother would visit. This is the same gravesite where Gray himself was later buried.
Gray also wrote light verse, including Ode on the Death of a Favourite Cat, Drowned in a Tub of Gold Fishes, a mock elegy concerning Horace Walpole's cat. After setting the scene with the couplet "What female heart can gold despise? What cat's averse to fish?", the poem moves to its multiple proverbial conclusion: "a fav'rite has no friend", "[k]now one false step is ne'er retrieved" and "nor all that glisters, gold". (Walpole later displayed the fatal china vase (the tub) on a pedestal at his house in Strawberry Hill.)
Gray’s surviving letters also show his sharp observation and playful sense of humour. He is well known for his phrase, "where ignorance is bliss, 'tis folly to be wise." The phrase, from Ode on a Distant Prospect of Eton College, is possibly one of the most misconstrued phrases in English literature. Gray is not promoting ignorance, but is reflecting with nostalgia on a time when he was allowed to be ignorant, his youth (1742). It has been asserted that the Ode also abounds with images which find "a mirror in every mind". This was stated by Samuel Johnson who said of the poem, "I rejoice to concur with the common reader ... The Church-yard abounds with images which find a mirror in every mind, and with sentiments to which every bosom returns an echo". Indeed, Gray's poem follows the style of the mid-century literary endeavor to write of "universal feelings." Samuel Johnson also said of Gray that he spoke in "two languages". He spoke in the language of "public" and "private" and according to Johnson, he should have spoken more in his private language as he did in his "Elegy" poem.