A model investigation of the process of phase formation in photochromic glasses