  The discovery of Gamma-Ray Burst (GRB) afterglows revealed a new class of
variable sources at optical and radio wavelengths. At present, the environment
and precise redshift of the detected afterglows are still unknown. We show that
if a GRB source resides in a compact (<100pc) gas-rich environment, the
afterglow spectrum will show time-dependent absorption features due to the
gradual ionization of the surrounding medium by the afterglow radiation.
Detection of this time-dependence can be used to constrain the size and density
of the surrounding gaseous system. For example, the MgII absorption line
detected in GRB970508 should have weakened considerably during the first month
if the absorption occurred in a gas cloud of size <100pc around the source. The
time-dependent HI or metal absorption features provide a precise determination
of the GRB redshift.
