Aimed at graduate students and advanced undergraduates in physics and astronomy, this concise textbook covers all aspects of the ISM and IGM. It discusses the underlying physical processes that determine the properties of interstellar and intergalactic gas and it examines how astronomical observations are used to measure these properties.