He was born in the small village of Criech in Sutherlandshire on 20 October 1792, the son of Rev George Rainey the localChurch of Scotland minister, and his wife, Anne Robertson, daughter of Rev Gilbert Roberton of Kincardine. One of his brothers was George Rainy, the noted slave plantation owner and personality involved in the Highland Clearances. He studied medicine first at the University of Glasgow and then at the University of Edinburgh, graduating in 1812. From 1812 to 1814 he acted as a clerk at Glasgow Royal Infirmary then went to Paris for further studies and to experience work in Paris hospitals. He was in Paris on 20 March 1815 to witness the crowds welcoming the triumphant return of Napoleon after his escape from Elba. In Paris he met and befriended the anatomist, Guillaume Dupuytren and the toxicologist Mathieu Orfila. He left Paris in the summer of 1815. He returned via Brussels, and in early June passed the then unknown village of Waterloo where two weeks later it would pass into world history with the defeat of Napoleon. He set up in private practice in his home town of Glasgow at 157 West George Street. He instigated the Glasgow Eye Infirmary in 1824. He also lectured in the Institutes of Medicine at the University of Glasgow 1832 to 1839, gaining his MD in 1833. In 1839 he began lecturing in the Practice of Medicine. In 1841 he was created Professor of Forensic Medicine and Medical Jurisprudence. He resigned in 1862 to concentrate on his ongoing private practice. In the Disruption of 1843 he left the established church of his late father to join the Free Church of Scotland, in which his son Robert was a leading figure. In 1852 he was made Vice Rector of the University of Glasgow. The University granted him a further honorary doctorate in 1873. He died at home, 2 Woodside Place in Glasgow on 6 August 1876.
His grandson, George's son, also Harry Rainy, followed in his footsteps. Harry was born in Glasgow but the family moved to George Square in Edinburgh in 1870 following his father's premature death when Harry was only five. He was educated at Edinburgh Academy. He then studied Medicine at the University of Edinburgh, attaining an MA, MB, CM, and finally his MD in 1899. In 1897 he was elected a Fellow of the Royal Society of Edinburgh. His proposers were Sir Thomas Richard Fraser, John Sturgeon Mackay, Alexander Bruce, and Diarmid Noel Paton. He died at 16 Great Stuart Street in Edinburgh on 4 January 1923.