Active-cavity-enhanced spectroscopy