After marrying, Gray moved with his wife Loretta to New Jersey, his wife's home state; she got a job as a teacher and he got one at Bell Labs working on a digital simulation that was to be part of Multics. At Bell, he worked three days a week and spent two days as a Master's student at New York University's Courant Institute. After a year they traveled for several months before settling again in Berkeley, where Gray entered graduate school with Michael A. Harrison as his advisor. In 1969 he received his Ph.D. in programming languages, then did two years of postdoctoral work for IBM.