The 6-foot-7 Martin has averaged 5.4 points and 14.3 minutes in 220 games for Atlanta, Chicago, Washington, Golden State and Charlotte. Martin played in a career-high 59 games last season with Atlanta and Chicago, averaging 5.6 points.
Gray, a 7-footer, has averaged 3.4 points and 12.1 minutes in 318 career games with Chicago, New Orleans, Toronto and Sacramento. He split time between Toronto and Sacramento during the 2013-14 season, appearing in 37 games and averaging 1.8 points.
The contracts were announced on Monday.