The behavior of volatiles on the lunar surface