  The interaction of a radiation field with a dusty medium is a relevant issue
in several astrophysical contexts. We use the time-dependent photoionization
code in a dusty medium developed by Perna & Lazzati (2002), to study the
modifications in the dust distribution and the relative optical opacities when
a strong X-ray UV radiation flux propagates into a medium. We find that
silicates are preferentially destroyed with respect to graphite, and the
extinction curve becomes significantly flatter (hence implying less reddening),
with the characteristic bump at lambda 2175 A highly suppressed, due to the
destruction of the small graphite grains. This could explain the observational
lack of such a feature in GRB afterglow and AGN spectra. For a very intense and
highly variable source irradiating a compact and dense region, time variability
in the optical opacity resulting from dust destruction can be observed on a
relatively short timescale. We show that, under these circumstances, monitoring
the time variability of the opacity can yield powerful clues on the properties
of dust in the environment of the source. In particular, it allows to break the
observational degeneracy as to whether a grey extinction is the result of a low
dust-to-gas ratio or of a dust grain distribution that is skewed towards large
grains.
