In 1916, Einstein addressed these two contradictions (the instant propogation problem and the equivalence of gravity and acceleration) by reconstructing the theory of gravity. Einstein presented the world with a new understanding of the world- his theory of general relativity. In this theory, space is not an empty void, but an invisible structure called spacetime. Nor is space simply a three-dimensional grid through which matter and energy moves. It is a four-dimensional structure whose shape is determined by the presence of matter and energy. Around any mass (or energy), spacetime is curved. The presence of planets, stars and galaxies deform the fabric of spacetime like a large ball deforms a bedsheet. (This deformation occurs in four dimensions, so the two-dimensional bedsheet is a limited model. Try visualizing these depressions on all sides of a planet to build a more accurate image of this concept.)
When a smaller mass passes near a larger mass, it curves toward the larger mass because spacetime itself is curved toward the larger mass. The smaller mass is not "attracted" to the larger mass by any force. The smaller mass simply follows the structure of curved spacetime near the larger mass. For example,the massive Sun curves spacetime around it, a curvature that reaches out to the edges of the solar system and beyond. The planets orbiting the Sun are not being pulled by the Sun; they are following the curved spacetime deformed by the Sun.