The Dow Jones Industrial Average gained 337 points Thursday after senators announced a deal to extend the debt ceiling.