Aims. Messier 8 is one of the brightest HII regions in the sky. We collected an extensive dataset comprising multiple submillimeter spectral lines from neutral and ionized carbon and from CO. Based on it, we aim to understand M8's morphology and that of its associated photo dissociation region and to carry out a quantitative analysis of the regions' physical conditions such as kinetic temperatures and volume densities. Methods. Using the Stratospheric Observatory For Infrared Astronomy (SOFIA), the Atacama Pathfinder Experiment (APEX) 12 m and the Institut de Radioastronomie Millimétrique (IRAM) 30 m telescopes, we have performed a comprehensive imaging survey of the emission from the fine structure lines of [C II] and [C I] and multiple rotational transitions of carbon monoxide (CO) isotopologues within 1.3 × 1.3 pc around the dominant Herschel 36 (Her 36) system composed of at least three massive stars. To further explore the morphology of the region we compare archival infrared, optical and radio images of the nebula with our newly obtained fine structure line and CO data, in particular with the velocity information they provide. We perform a quantitative analysis, using both LTE and non-LTE methods to determine the abundances of some of the observed species as well as kinetic temperatures and volume densities. Results. Bright CO, [C II] and [C I] emission has been found towards the HII region and the photodissociation region (PDR) in M8. Our analysis places the bulk of the molecular material in the background of the nebulosity illuminated by the bright stellar systems Her 36 and 9 Sagitarii. Since the emission from all observed atomic and molecular tracers peaks at or close to the position of Her 36, we conclude that the star is still physically close to its natal dense cloud core and heats it. A veil of warm gas moves away from Her 36 toward the Sun and its associated dust contributes to the foreground extinction in the region. One of the most prominent star forming regions in M8, the Hourglass Nebula, is particularly bright due to cracks in this veil close to Her 36. By using radiative transfer modeling of different transitions of CO isotopologues, we obtain H 2 densities ranging from ∼ 10 4 -10 6 cm -3 and kinetic temperatures of 100 -150 K in the bright PDR caused by Her 36.