  Opacity effects in relativistic sources of high-energy gamma-rays, such as
gamma-ray bursts (GRBs) or Blazars, can probe the Lorentz factor of the outflow
and the distance of the emission site from the source, and thus help constrain
the composition of the outflow (protons, pairs, magnetic field) and the
emission mechanism. Most previous works consider the opacity in steady state.
Here we study time dependent effects of the opacity to pair production
($\gamma\gamma \to e^+e^-$) in impulsive relativistic sources. We present a
simple, yet rich, semi-analytic model for the time and energy dependence of the
optical depth, $\tau$, where an ultra-relativistic thin spherical shell emits
isotropically in its own rest frame over a finite range of radii, $R_0 < R <
R_0 + \Delta R$. This is very relevant for GRB internal shocks. We find that in
an impulsive source ($\Delta R <~ R_0$), while the instantaneous spectrum has
an exponential cutoff above the photon energy $\epsilon_1(T)$ where $\tau = 1$,
the time integrated spectrum has a power-law high-energy tail above a photon
energy $\epsilon_{1*} \sim \epsilon_1(\Delta T)$ where $\Delta T$ is the
duration of the emission episode. Furthermore, photons with $\epsilon >
\epsilon_{1*}$ will arrive mainly near the onset of the spike or flare from to
the short emission episode, as in impulsive sources it takes time to build-up
the (target) photon field, and thus $\tau(\epsilon)$ initially increases with
time and $\epsilon_1(T)$ decreases with time, so that photons of energy
$\epsilon > \epsilon_{1*}$ are able to escape the source mainly very early on
while $\epsilon_1(T) > \epsilon$. As the source approaches a quasi-steady state
($\Delta R >> R_0$), the time integrated spectrum develops an exponential
cutoff, while the power-law tail becomes increasingly suppressed.
