Radiation on a semi-infinite plate and the Smith-Purcell effect in the X-ray range