For a simplicial complex $K$ on $m$ vertices and simplicial complexes $K_1,\ldots ,K_m$, we introduce a new simplicial complex $K(K_1,\ldots ,K_m)$, called a substitution complex. This construction is a generalization of the iterated simplicial wedge studied by A. Bari, M. Bendersky, F. R. Cohen, and S. Gitler. In a number of cases it allows us to describe the combinatorics of generalized joins of polytopes $P(P_1,\ldots ,P_m)$, as introduced by G. Agnarsson. The substitution gives rise to an operad structure on the set of finite simplicial complexes in which a simplicial complex on $m$ vertices is considered as an $m$-ary operation. We prove the following main results: (1) the complex $K(K_1,\ldots ,K_m)$ is a simplicial sphere if and only if $K$ is a simplicial sphere and the $K_i$ are the boundaries of simplices, (2) the class of spherical nerve-complexes is closed under substitution, (3) multigraded betti numbers of $K(K_1,\ldots ,K_m)$ are expressed in terms of those of the original complexes $K, K_1,\ldots ,K_m$. We also describe connections between the obtained results and the known results of other authors.