Career
Gray was originally master of the high school of Dumfries, and there became intimate with Robert Burns. From 1801 till 1822 he was master in the high school of Edinburgh. In 1822 he became Headmaster of the academy at Belfast.
He was eventually stationed at Bhuj in Kutch, and was entrusted by the British government with the education of the young Rao of that province Deshalji II, being, it is said, the first Christian who was ever honoured with such an appointment.
Gray died at Bhuj on 25 March 1830. Gray married Mary Phillips of Longbridgemoor, Annandale, eldest sister of the wife of James Hogg.
His family mostly settled in India. Hogg introduced Gray into the Queen"s Wake, as the fifteenth bard who sang the ballad of King Edward"s Dream.