We tested an approach for calculating the effective elastic properties of rocks taking into account their critical porosity (the percolation threshold). The concept of critical porosity considers that when the porosity of a rock exceeds the critical value, the shear modulus of the rock tends to zero, making it lose its rigidity and the rock falls apart. The classical homogenization schemes do not describe the mechanical properties of a rock near the critical porosity. The approach proposed here is based on the generalized differential effective medium (GDEM) method. We introduce a model of porous elastic media composed of an elastic solid host containing ellipsoidal inclusions of two types. Inclusions of the first type (phase 1) represent pores, and inclusions of the second type (phase 2) contain elastic solid material described by the same elastic properties as the host (phase 0). In this model, with an increase in porosity, the concentration of the host decreased, and it tended to zero near the critical porosity. The model was used for simulation of rock elastic moduli. We compared the modeling results for elastic moduli and acoustic velocities with the experimental data and empirical petrophysical equations. The comparison showed that the GDEM model describes the elastic properties behavior in a wide range of porosity up to the critical value.