Silicon substrates with p-n junction were layer-by-layer etched along the depth of the n-layer by the method of electrochemical anodization on the surface; the obtained porous silicon films were analyzed by means of voltammetric response, reflection spectra and photoluminescence spectra as a function of the conductivity of the gradient layer along the depth of the p-n junction. It is shown that current flow across the thin-film layer, in particular, with the increase of the layer resistance along the etching depth there appears a region of space charge associated with the depletion of charge in the vicinity of the p-n junction and an increase in the forward current-voltage characteristics, after which current rectification begins.