  We consider the effect of loss on quantum-optical communication channels. The
channel based on direct detection of number states, which for a lossless
transmission line would achieve the ultimate quantum channel capacity, is
easily degraded by loss. The same holds true for the channel based on homodyne
detection of squeezed states, which also is very fragile to loss. On the
contrary, the ``classical'' channel based on heterodyne detection of coherent
states is loss-invariant. We optimize the a priori probability for the
squeezed-state and the number-state channels, taking the effect of loss into
account. In the low power regime we achieve a sizeable improvement of the
mutual information, and both the squeezed-state and the number-state channels
overcome the capacity of the coherent-state channel. In particular, the
squeezed-state channel beats the classical channel for total average number of
photons $N<8$. However, for sufficiently high power the classical channel
always performs as the best one. For the number-state channel we show that with
a loss $\eta\lesssim .6$ the optimized a priori probability departs from the
usual thermal-like behavior, and develops gaps of zero probability, with a
considerable improvement of the mutual information (up to 70 % of improvement
at low power for attenuation $\eta=.15$).
