From thermal to stimulated emission of light