Gray was born on 6 January 1882 at Dundee, the son of an art teacher, and died on 17 February 1968 in Edinburgh. He married Alice Gunn, daughter of an Edinburgh solicitor, in 1909; they had one son and three daughters. Gray was knighted in 1947. He was educated at Dundee High School and then at Edinburgh University where he was awarded a first in mathematics in 1903 and, after study at Paris and Göttingen, another first, in economic science, in 1905. He came second in the civil service examinations to John Anderson, later Chancellor of Exchequer in 1943, his fellow student and lifelong friend. Gray spent sixteen years in the civil service chiefly working on social insurance before he turned to an academic career as professor of economics at Aberdeen (1921–35) and then Edinburgh (1935–55). He was a Short ruddy-faced man noted for his frugal Calvinism and Rabelaisian humour. No student forgot his robust teaching nor the sight of him playing the organ in the Pollock Hall as his Edinburgh University ordinary class of four hundred students assembled to hear his pungent lectures.
From The Biographical Dictionary of British Economists in Oxford Reference.