  In the framework of the Keldysh technique, we formulate the nonlinear sigma
model for disordered optical media with linear absorption or gain. The
effective action for fluctuations of the matrix field about the saddle point
acquires an extra term due to the nonconservative nature of the system. We
determine the disorder-averaged Green-function correlator, which has a
diffusion pole modified by a finite absorption/gain rate. The diffusion
coefficient is found to be close to its value for conservative systems in the
relevant range of parameters. In the medium with gain, the random-lasing
threshold depends on the sample size.
