An explicit expression is obtained for the Green's functions of a massive scalar field for nonnull temperatures and density in the form of a series in powers of m/T. The equivalence of the spectral-geometric approach and the temperature technique of Matsubara and Bernard is demonstrated. Corrections to the Stefan-Boltzmann law are obtained on the basis of the calculated Green's functions. The energy density is calculated in regions of high and low temperatures. The formulas obtained can prove to be useful in the discussion of the phase transition hadrons-quark-gluon plasma.