The authors have developed a consistent theory concerning the generation of a second harmonic when an electromagnetic wave is incident on a weakly inhomogeneous isotropic plasma, and have studied the dependence of the effect on plasma temperature. They point out the qualitative difference between the mechanisms of second harmonic generation in cases involving low and high temperatures and indicate the oscillatory nature of the intensity of second-harmonic emission. Attention is drawn to the strong enhancement of the effect when the density profile has inflection or extremum points. The influence of changes in density profile due to the high-frequency pressure of the incident wave on the generation of the second harmonic is discussed. The significance of second-harmonic generation in the laser-power heating problem is also discussed.