The development of spatially homogeneous mixed structures with boron (B), nitrogen (N) and carbon (C) atoms arranged in a honeycomb lattice is highly desirable, as they open the possibility of creating stable two-dimensional materials with tunable band gaps. However, at least in the free-standing form, the mixed BCN system is energetically driven towards phase segregation to graphene and hexagonal BN. It is possible to overcome the segregation when BCN material is grown on a particular metal substrate, for example Ru(0 0 0 1), but the stabilization mechanism is still unknown. With the use of density-functional theory we study the energetics of BN/Ru slabs, with different types of configurations of C substitutional defects introduced to the h-BN overlayer. The results are compared to the energetics of free-standing BCN materials. We found that the substrate facilitates the C substitution process in the h-BN overlayer. Thus, more homogeneous BCN material can be grown, overcoming the segregation into graphene and h-BN. In addition, we investigate the electronic and transport gaps in free-standing BCN structures, and assess their mechanical properties and stability. The band gap in mixed BCN free-standing material depends on the concentration of the constituent elements and ranges from zero in pristine graphene to nearly 5 eV in free-standing h-BN. This makes BCN attractive for application in modern electronics.