David Gray was born at Merkland, near Kirkintilloch, Dumbartonshire, one of eight children of a handloom weaver. He was educated at the local parish school and his parents had ambitions for him to become a Free Church minister. He briefly attended Glasgow University and was already writing poems for the Glasgow Evening Citizen when he decided in 1860 to accompany his great friend Robert Buchanan to London in search of literary fame.
He had already started work on the poem for which he posthumously became famous, The Luggie, a stream which runs through Merkland, which evoked memories of his childhood. In spite of the help of his patron, Monkton Miles, Later Lord Houghton, however, he was unable to find a publisher for it. Not long after his arrival in London he developed tuberculosis and was sent to Torquay in the hope that he would benefit from the sea air. His health did not improve and at the beginning of 1861 he returned to his home town of Kirkintilloch where he died in December of that year at the age of 23, his promise only partially fulfilled.
A volume of his poetry, The Luggie and Other Poems, was published in 1862 by the efforts of Sydney Dobell, a friend and fellow poet. Well aware that he would not survive, in the final year of his life he wrote a series of thirty beautiful sonnets entitled In the Shadows which contain much sadness but no hint of morbidness. His great friend, Robert Buchanan, who went on to achieve considerable success both as a poet and dramatist, wrote two poems in his honour, Poet Andrew and To David in Heaven as well as a biography of him.
He is buried in Auld Isle churchyard in Kirkintilloch, where the self-penned epitaph on his tomb reads:
Below lies one whose name was traced in sand—
He died not knowing what it was to live:
Died while the first sweet consciousness of manhood
And maiden thought electrified his soul:
Faint beatings in the calyx of the rose.
Bewildered reader, pass without a sigh
In a proud sorrow
There is life with God
In other kingdom of a sweeter air
In Eden every flower is blown: Amen
On reading only this, one wonders to what great heights he may have risen had he but lived.