In addition to the familiar DxDp >= constant, another form of the uncertainty principle is DtDE >=constant, where DE is the uncertainty in energy <-> frequency, which corresponds to the line width. Dt is the uncertainty in the lifetime <-> decay constant, which is not infinitely long. Therefore DE can not be infinitely narrow. For isolated gas molecules, the lack of interactions makes the life very long, thus the line width very narrow. In condensed phase, the life time is much shorter so the line width is much broader. It is also related to Fourier Transform, which is also intimately related to uncertainty principle.