The boundary problem of linear classical optics about the interaction of electromagnetic radiation with a thin dielectric film has been solved under explicit consideration of its discrete structure. The main attention has been paid to the investigation of the near-zone optical response of dielectrics. The laws of reflection and refraction for discrete structures in the case of a regular atomic distribution are studied and the structure of evanescent harmonics induced by an external plane wave near the surface is investigated in details. It is shown by means of analytical and numerical calculations that due to the existence of the evanescent harmonics the laws of reflection and refraction at the distances from the surface less than two interatomic distances are principally different from the Fresnel laws. From the practical point of view the results of this work might be useful for the near-field optical microscopy of ultrahigh resolution.