The 50-year-old ex-Darlington manager has agreed a two-year contract at Cherrywood Road.
Gray said: "With the recent troubles at the club it is my job to help get it back on a sound footing. This will include improving the infrastructure. I look forward to the challenge and hopefully I can put a smile back on the faces of people that support Town."
Gray, who also played for Nottingham Forest, needs to transform a team that finished second bottom of the Conference.