The theory of general relativity describes how mass and energy affect the curvature of space and time.