Offshore driller Ensco Plc said it would buy smaller rival Atwood Oceanics Inc in an all-stock deal valued at about $839 million.