Gray started his law career in 1969 as a VISTA attorney with Neighborhood Legal Services in Pittsburgh, Pennsylvania. In 1972 he became director of Legal Services for Central Pennsylvania. In 1976 he went into private practice on Duke Street in Lancaster, Pennsylvania. In July 2004, Gray was a highly regarded Defense attorney, and had formed an exploratory committee for his run for Mayor. He officially announced his candidacy on the front steps of his home on 12 February 2005, citing the city's rising financial deficit as an important issue he would fix. At the 4 August 2005 debate with incumbent Mayor Charlie Smithgall he continued to argue that the city's 4 million dollar deficit was the major issue, when his opponent claimed local crime as the most important priority. Gray was sworn in on 3 January 2006, stating his immediate goals for his new administration: "Job No. 1 is to get our fiscal house in order. Job No. 2 is to get the convention center straightened out. And No. 3, I think, is community policing." In 2006, Gray proposed an ordinance to charge home owners a fee to have their satellite dish visible in the front of their house in the historic district of Lancaster, arguing it took away from the value of the district's historic look. Gray endorsed Senator Barack Obama in March 2008 for the 2008 Democratic Presidential primaries. Later that year he lost a bid to be an Obama delegate at the Democratic National Convention, but still attended as his wife was selected to be a Pennsylvania delegate at large. The two both hate flying and so they decided to ride across country on their motorcycles. In June 2008, Gray was elected to be one of the directors at large of the Pennsylvania League of Cities and Municipalities. Gray was reelected to a second term in the 2009 Lancaster mayoral election defeating for a second time Republican former Mayor Charlie Smithgall. Gray endorsed Tom Wolf in the 2014 Democratic Primary for Governor and he endorsed Katie McGinty in the 2016 Democratic Primary for the United States Senate. Gray declined to run for a fourth term in the 2017 election, and was succeeded by fellow Democrat Danene Sorace on January 3, 2018.