Gray was born on 29 December 1845 in Dublin, the second son of Sir John Gray and his wife Anna Dwyer. After receiving his education, he joined his father in managing the Freeman's Journal, the oldest nationalist newspaper in Ireland. When his father died in 1875, Gray took over proprietorship of the Journal, and his family's other newspaper properties such as the Belfast Morning News and the Dublin Evening Telegraph. In 1868, Gray saved five people from drowning in a wrecked schooner at Killiney Bay, an action for which he received the Tayleur Fund Gold Medal for bravery from the Royal Humane Society. By coincidence, the rescue was witnessed by his future wife, Caroline Agnes Gray, whom he would meet shortly afterwards. Agnes was the daughter of Caroline Chisholm, and although Gray was descended from a Protestant family, he converted to Catholicism to marry her. The wedding in London on 17 July 1869 was conducted by the Bishop of Northampton. The couple had one son, Edmund Dwyer-Gray, who would take over from his father as proprietor of his newspapers and would go on to become Premier of Tasmania.
Political career
From 1875 to 1883, Gray served as a member of the Dublin Corporation, and in 1880 served a term as Lord Mayor of Dublin. Unusually for an Irish nationalist politician, Gray was very much focussed on urban rather than rural affairs, and like his father was heavily involved in public health and water provision for Dublin. He also promoted reform in the municipal health system. Gray unsuccessfully ran for his father's seat of Kilkenny City at Westminster in the 1875 by-election that followed Sir John Gray's death. He won a later by-election in 1877, becoming a Member of Parliament representing Tipperary for the Home Rule League. At the 1880 general election, he won the seat of Carlow County. At the 1885 election, as a member of the Irish Parliamentary Party, he won representation of both Carlow and the new constituency of Dublin St Stephen's Green, and chose to represent the latter. He was imprisoned for six weeks in 1882 for remarks made in the Freeman's Journal with regard to the composition of the jury in the case of a murder trial. The defendant in the case in question was later hanged. A heavy drinker and asthma sufferer, Gray died aged 42 after a short illness on 27 March 1888, and was buried at Glasnevin Cemetery.