The process of drying a flat sample with electromagnetic radiation is considered. As initial relations, the equations of the theory of heat and mass transfer are used. To take into account the nonlinear nature of the process of mass transfer of the sample surface with the air medium, the boundary conditions for the moisture fluxes were adopted in the form of Dalton's evaporation law. A time-asymptotic analytic solution of the initial-boundary value problem is constructed, the characteristic feature of which is the stationarity of the temperature field T, the quasistationary nature of the moisture content field U, and the constant of the drying intensity J. The presence of such features allows us to say that here we have, by analogy with convective drying, or a period of constant rate. The central notion in the relations obtained is the steady-state temperature of the material surface T-infinity, which is a generalization of the concept of the temperature of a wet thermometer for the case of electromagnetic drying. The problem of drying optimization has been set and solved. The aim of optimization is to organize regimes in which the temperature field and the moisture content field are close to homogeneous. This corresponds to the minimization of the objective functions, which are the absolute values of the temperature and moisture content differences between the plate boundaries vertical bar Delta T vertical bar and vertical bar Delta U vertical bar. As optimization parameters, by varying the target functions, the intensity of radiation S and its penetration depth Delta are chosen. It is shown that the optimum regime should be chosen in the soft range, in which the Delta T and Delta U differences have the same signs, and the hard range in which these differences have opposite signs should be excluded from consideration. One of the limits of the soft range corresponds to the regime with Delta T=0, the other boundary to the regime with Delta U=0. An algorithm for calculating the optimization parameters S and Delta, corresponding to these modes, is developed, which makes it possible to organize drying within a soft range. As an example of using the developed algorithm, optimization of electromagnetic drying of a material with characteristics of quartz sand has been carried out.