Algorithms for modeling the spatial structure of foam materials for the formation of projections in X-ray computed tomography and subsequent reconstruction of the internal structure of the samples are proposed. Algorithms are the basis of numerical models of the analyzed systems as applied to foam control. To demonstrate the capabilities of the developed algorithms, synograms and results of reconstruction of the internal structure of foam materials samples with variation of their parameters were obtained.