Through coupling optical processes with the scanning tunneling microscope (STM), single-molecule chemistry and physics have been investigated at the ultimate spatial and temporal limit. Electrons and photons can be used to drive interactions and reactions in chemical systems and simultaneously probe their characteristics and consequences. In this review we introduce and review methods to couple optical imaging and spectroscopy with scanning tunneling microscopy. The integration of the STM and optical spectroscopy provides new insights into individual molecular adsorbates, surface-supported molecular assemblies, and two-dimensional materials with subnanoscale resolution, enabling the fundamental study of chemistry at the spatial and temporal limit. The inelastic scattering of photons by molecules and materials, that results in unique and sensitive vibrational fingerprints, will be considered with tip-enhanced Raman spectroscopy. STM-induced luminescence examines the intrinsic luminescence of organic adsorbates and their energy transfer and charge transfer processes with their surroundings. We also provide a survey of recent efforts to probe the dynamics of optical excitation at the molecular level with scanning tunneling microscopy in the context of light-induced photophysical and photochemical transformations.