He was the son of Samuel Gray, a London seedsman. He received no inheritance and, after failing to qualify for medicine, turned to medical and botanical writing. He married Elizabeth Forfeit in 1794 and moved to Walsall, Staffordshire, where he established an assay office before he moved back to London in 1800.
Gray wrote a Supplement to the Pharmacopoeia, published in 1818 with several subsequent editions. In 1819, he became co-editor of the London Medical Repository, to which he contributed many articles on medical, botanical, and other topics. He published, in 1823, The Elements of Pharmacy and, in 1828, The Operative Chemist, both practical reference works.
Gray's major text of interest today is The Natural Arrangement of British Plants, published in two volumes in 1821. The authorship is disputed, and his son, John Edward Gray, later claimed to have done most of the work, but that was not supported by his grandson. The book itself is innovative, being the first British flora to employ Antoine Laurent de Jussieu's natural system of plant classification, an improvement on the artificial classification of Linnaeus. Probably, that was what made it be poorly received by conservative botanists of the day. The Natural Arrangement of British Plants also included substantial sections on fungi, then classed as cryptogamic plants, introducing many new genera, including Auriscalpium, Coltricia, Leccinum, and Steccherinum, which remain in current use.
Despite its recognised nomenclatural importance today, it was neglected by British botanists after its publication for "its idiosyncrasies, anti-Linnaean character, unorthodox nomenclature, narrow generic concepts and contemporary hostility to the supposed author R. A. Salisbury."