  Motivated by recent experiments, which demonstrated lasing and cooling of the
electromagnetic modes in a resonator coupled to a superconducting qubit, we
describe the specific mechanisms creating the population inversion, and we
study the spectral properties of these systems in the lasing state. Different
levels of the theoretical description, i.e., the semi-classical and the
semi-quantum approximation, as well as an analysis based on the full Liouville
equation are compared. We extend the usual quantum optics description to
account for strong qubit-resonator coupling and include the effects of
low-frequency noise. Beyond the lasing transition we find for a single- or
few-qubit system the phase diffusion strength to grow with the coupling
strength, which in turn deteriorates the lasing state.
