Control of optical properties of single molecules by plasmonic nanostructures is an important issue in plasmonics and nanophotonics, particularly valuable for the development of molecular optoelectronic devices and ultrasensitive high-resolution microscopic techniques. The nanocavity defined by the coinage-metal tip and substrate in a scanning tunneling microscope (STM) can provide highly localized and dramatically enhanced electromagnetic fields upon proper plasmonic resonant tuning, which can modify the excitation and emission of a single molecule inside and produce intriguing new optoelectronic phenomena. In this talk, I shall demonstrate two STM-based phenomena related to single-molecule optical spectroscopy.