The development of new characterization methods has resulted in innovative studies of the properties of two-dimensional (2D) materials. Observations of nanoscale heterogeneity with scanning probe microscopy methods have led to efforts to further understand these systems and observe new local phenomena by coupling light-based measurement methods into the tip-sample junction. Bringing optical spectroscopy into the near-field in ultrahigh vacuum at cryogenic temperatures has led to highly unique studies of molecules and materials, yielding new insight into otherwise unobservable properties nearing the atomic scale. Here, we discuss studies of 2D materials at the subnanoscale where the measurement method relies on the detection of visible light scattered or emitted from the scanning tunneling microscope (STM). We focus on tip-enhanced Raman spectroscopy, a subset of scattering-type scanning near-field optical microscopy, where incident light is confined and enhanced by a plasmonic STM tip. We also mention scanning tunneling microscope induced luminescence, where the STM tip is used as a highly local light source. The measurement of light-matter interactions within the atomic STM cavity is expected to continue to provide a useful platform to study new materials.