  We investigate the dynamics and afterglow light curves of gamma-ray burst
(GRB) blast waves that encounter various density structures (such as bumps,
voids, or steps) in the surrounding ambient medium. We present and explain the
characteristic response features that each type of density structures in the
medium leaves on the forward shock (FS) and reverse shock (RS) dynamics, for
blast waves with either a long-lived or short-lived RS. We show that, when the
ambient medium density drops, the blast waves exhibit in some cases a period of
an actual acceleration (even during their deceleration stage), due to adiabatic
cooling of blast waves. Comparing numerical examples that have different shapes
of bumps or voids, we propose a number of consistency tests that correct
modeling of blast waves needs to satisfy. Our model results successfully pass
these tests. Employing a Lagrangian description of blast waves, we perform a
sophisticated calculation of afterglow emission. We show that, as a response to
density structures in the ambient medium, the RS light curves produce more
significant variations than the FS light curves. Some observed features (such
as re-brightenings, dips, or slow wiggles) can be more easily explained within
the RS model. We also discuss on the origin of these different features
imprinted on the FS and RS light curves.
