Porous surface layers were studied in a series of p-type Si samples etched anodically in electrolytes based on hydrofluoric acid. The optical response of the structure consisting of substrate and surface layers was investigated by spectroscopic ellipsometry in the range 1-5 eV. The experimental results were compared with calculations, which model the optical response of a multilayer structure. The model parameters were compared to the structural data obtained by AFM and SEM studies. The experimental investigations and model calculations revealed the regularities in the dependence of the optical response on the doping degree of substrate and parameters of technological procedure.