We study radiative transfer in plasma by numerical solution of kinetic Boltzmann equations for all particles. We are interested in the thermalization of photons. We considered three cases: 1. The calculations of the timescales of the thermalization in the uniform isotropic plasma. 2. The expansion of the mildly relativistic pair plasma for the mini fireball in the frame of the kinetic approach. 3. The case of ultra relativistically expanding outflow from the surface of the compact object with the Fokker-Planck approximation to the Boltzmann equation for photons. The last case gives the generalized Kompaneets equation which takes into account anisotropic distribution of photons developed near the photosphere. For the electron temperature dependence from radius T ∝ r −2 and thermal electrons spectrum we found the low-energy photon index can be 0.5 as typically observed in GRB.