FRANKLIN LAKES, N.J. — Medical technology firm Becton, Dickinson and Co. says it has reached an agreement to buy competitor C.R. Bard Inc. in a cash-and-stock deal worth $24 billion. The deal announced Sunday was approved by both companies’ boards but still needs regulatory and Bard shareholder approvals. It’s expected to close in the fall.