A promising approach to obtain light emission from Si-based materials is represented by doping with rare earths and in particular with Eu. In this paper the comparison of the performances of SiO2 and SiOC layers as host matrices for optically active Eu ions is presented. A SiO2 matrix allows to observe light emission from both Eu2+ and Eu3+ ions, owing to a proper tuning of the thermal annealing process used to optically activate the rare earth. However the photoluminescence efficiency of both ions remains relatively low and quite far from the requirements for technological applications, mainly due to the extensive formation of Eu-containing precipitates. A detailed study of the structural and optical properties of these layers allowed us to analyze and elucidate the clustering process and to find suitable strategies to minimize it. We found that the substitution of the SiO2 matrix with a SiOC film allows to obtain a very bright light emission at about 440 nm from Eu2+ ions. In fact SiOC is able to efficiently promote the Eu reduction; furthermore, Eu ions are characterized by an enhanced mobility and solubility in this matrix and, as a consequence, Eu precipitation is strongly reduced. Finally, by taking advantage of the dependence of the photoluminescence peak position on the Eu concentration, an intense white emission is obtained at room temperature by combining two layers with different Eu contents. Since SiOC is a material fully compatible with standard Si technology, Eu-doped SiOC layers can be considered a highly interesting candidate for applications in photonics or in solid-state lighting.