This paper contains a new theoretical approach for analyzing Smith-Purcell radiation. The new theory is self-consistent, i.e., it takes into account the effect of the radiation back on the beam. This approach is not only more precise than the previously available one, but it brings to light a number of new effects. It shows that two kinds of waves contribute to radiation, namely, slow and fast space-charge waves, and demonstrates that these waves are of leaky nature. The numerical results show in detail that there is an optimum beam thickness and an optimum beam velocity.