Very often it is desirable to grow quantum wells of ternary alloys such as Zn1-xCd,Se and Zn1-xCdxTe with different composition in the same sample. One way is to stop the growth, change the cell temperatures to modify the cation flux ratio and, after reaching stable conditions, proceed with the sample growth. An alternative is the use of digital methods to produce alloys with an expected average composition. In this work we present a new method, submonolayer pulsed beam epitaxy, that produces homogeneous cationic layers with a given composition that can be varied without stopping the growth and without changing cell temperatures. In this method the sample surface is exposed to Cd-Zn-Se or Cd-Zn-Te cycles with submonolayer cationic coverage. During the exposure of the surface to Zn flux empty cationic sites are filled with Zn and, additionally, due to the stronger Zn-(Se, Te) chemical bond, some Cd atoms are substituted by Zn atoms and evaporate from the surface. The exposure time to Zn plays a main role in the final alloy composition.