Professor of Medicine. Gregory was the great-grandson of another James Gregory (1638-75), the mathematician, and son of the Professor of Medicine at Aberdeen and Edinburgh. He was educated in Aberdeen, Edinburgh and Oxford.
He was appointed to a Chair at the University of Edinburgh in 1776 and succeeded William Cullen (1710 - 1790) on his death as Professor of Medicine. He is primarily remembered for Gregory's Powder, a mixture of pulverised rhubarb, ginger and magnesia, prescribed as a laxative. Although known as an able lecturer and physician, he irritated his peers through his rows. Gregory also upset the poet Robert Burns (1759-96) with stinging criticism of one of his poems.
Gregory was given the Freedom of the City of Edinburgh in 1815. He was buried in the Canongate Kirkyard.