  We investigate through dedicated numerical simulations the evolution of the
soft X-ray absorption properties of a cloud surrounding a gamma-ray burst
source. We show that the absorption properties of the material are strongly
modified by the ionization induced by the intense burst flux. We derive the
temporal evolution of the measured column density as a function of the density
and size of the absorbing medium. Even if their statistical significance is not
extremely compelling, we find that the detection in several bursts of variable
absorption during the gamma-ray phase can be accounted for if these bursts are
associated to overdense regions in molecular clouds with properties similar to
those of star formation globules. We fit our model variable column density to
the data of GRB 980329 and GRB 780506, showing that with this method the size,
density and density distribution of the material surrounding a burst can be
measured.
