The former Wigan and Tranmere manager will now lead the side in the Blue Square Bet Premier next season.
Chief executive Graham Shaw said: "We are delighted Ray has accepted the challenge and look forward to an exciting time ahead."
Mathias had previously stated his desire to lead the club after their 106-year stint in the Football League ended this season.
The 64-year-old initially joined the club as a technical advisor, but was asked to take over leading the club's relegation fight from coach Peter Ward.
Mathias has had spells as assistant manager at Macclesfield and MK Dons, where he worked alongside Paul Ince before leaving with him for Blackburn Rovers.
Source: BBC Sport