Strain compensation is an important aspect of heterostructure engineering. In this letter, we discuss the synthesis of pseudomorphic Si1-yC y and Si1-x-yGexCy alloy layers on a silicon (100) substrate by molecular beam epitaxy using solid sources and the controlled strain compensation that results from the introduction of the ternary system. The introduction of C into substitutional sites in the crystal lattice is kinetically stabilized by low-temperature growth conditions (400-550°C) against thermodynamically favored silicon-carbide phases. The lattice constant in Ge is about 4% larger than in Si, whereas in diamond it is 52% smaller. Consequently, the compressive strain caused by 10.8% Ge in a pseudomorphic Si1-xGex alloy can be compensated by adding about 1% carbon into substitutional lattice sites of the film assuming Vegard's law of linear change of the lattice constant in the alloy as a function of the composition. Using x-ray diffraction, we observe a partial strain compensation in Si0.75-yGe0.25Cy alloys on Si depending on the amount of carbon in the layer, with no observable misfit dislocation generation. The Raman spectra from Si1-yCy and Si 1-x-yGexCy alloys show a substitutional carbon vibration mode at about 600 wavenumbers. No indication of silicon-carbide precipitation is observed in transmission electron microscopy and Raman spectroscopy.