Two sets of solgel derived glass materials have been prepared and subjected to different thermal treatments. Pyrolysis in inert atmosphere lead to the formation of amorphous Si(B)CO ceramics whereas if the inert atmosphere is changed to NH 3 once the carbon substituents of the preceramic hybrid material transform to a glassy network, the nitrogen is incorporated efficiently while the carbon is retained into the structure, as revealed by 29 Si NMR analysis. Raman spectra show a less graphitized structure in the case of B-rich materials because of the reduced mobility of the C atoms due to the formation of mixed (B)CN bonds.