AstraZeneca PLC said it agreed to buy Boston-based Alexion Pharmaceuticals Inc.ALXN for $39 billion in cash and stock, a move that would bolster the British drug giant’s footprint in immunology and rare diseases.