An Extension Theory for Rings