Google Inc. has agreed to pay $500 million to settle a U.S. government investigation into the Internet search leader’s distribution of online ads from Canadian pharmacies illegally selling prescription and non-prescription drugs to American consumers, a U.S. attorney said Wednesday.