  The study of the interstellar medium (ISM) in the X-rays has entered a golden
age with the advent of the X-ray observatories XMM-Newton and Chandra.
High-energy resolution allowed to study dust spectroscopic features with
unprecedented detail. At the same time, the X-ray imaging capabilities offered
a new perspective of dust scattering halos. Both spectroscopy and imaging rely
on a simple geometry, where a distant X-ray source, usually a bright X-ray
binary system, lies behind a multi-layered ISM. X-ray binaries can be found in
different regions in the Galaxy, providing the unique chance to study the ISM
in distinct environments. In the following we will describe how X-rays can be
used as a tool to study gas and dust along the line of sight, revealing
elemental abundances and depletion. The study of interstellar dust
spectroscopic and imaging features can be used to extract the chemical and
physical properties of the intervening dust, as well as its distribution along
the line of sight.
