NASA smashed a spacecraft into an asteroid in an attempt to throw it off course. The mission succeeded beyond expectations, officials said.