Former Scottish Open champion Gray made the maximum in the sixth frame of a 4-2 victory over Robbie Williams at the World Snooker Academy. It's the 80th official 147 in snooker history and the third of the season.
The Londoner also made a 147 at the 2004 UK Championship, on his way to the final.
The professional players enter PTC10 on Monday and the event runs until Wednesday.
Ball by ball scoring and results from tournaments