Electronic structures of bulk, bilayer and monolayer FeS2 are studied by DFT-GGA method. The band gap of the FeS2 monolayer is found to be of 0.73eV, which is well below the estimated bulk value (0.85eV). As a result, the gap reaches its maximum (1.39eV) for the bilayer FeS2. It is confirmed that the hybridization of Fe d states in the Fe-rich layer can lead to the decrease of the band gap down to the metallization of the surface. However, the Fe enrichment required for metallization must be very large, which makes it unrealistic. In contrast, the S-rich pyrite surface is found to be inherently metallic. This conclusion follows, in particular, from the revealed metallicity of the FeS3/FeS2 bilayer slab, in which the metallic properties stem from d states of Fe and p states of S of the FeS3 layer, while the FeS2 layer remains essentially semiconducting. Thus, the known decrease of the open-circuit voltage of pyrite solar cells can be attributed to the S enrichment, caused, for example, by surface segregation of sulfur.