Chemical reaction model for coexistence of three phases