You can avoid foreign transaction fees by getting a credit card that doesn't charge them. Considering that about 25% of current credit card offers don't charge foreign fees, and those cards are available to people of all credit levels, there's really no reason to pay these fees. The 10 largest credit card companies all offer at least some cards without foreign transaction fees. And some, like Capital One, Discover, USAA, HSBC and PenFed, don't charge foreign transaction fees on any of their credit cards.
Foreign transaction fees tack on as much as 4% extra to purchases made abroad, which can truly dampen a vacation. Foreign transaction fees aren't charged by the merchant; they're charged by the credit card company. And the fees are also charged for online purchases processed abroad, even if you're sitting in front of your computer at home when you make the purchase. If you're using a rewards card for purchases abroad, a foreign transaction fee will quickly negate the rewards you're trying to rack up. The fees are declared in all credit card terms, so make sure you look for that language when you're applying for credit cards.
That said, if you already have a credit card that charges foreign transaction fees, there's not much you can do to avoid them, save for not using the card abroad. Consider applying for a travel credit card with good ongoing rewards and no foreign transaction fees. There are plenty to choose from.
One last thing to think about regarding foreign transaction fees: Don't forget to find the right debit card for your travels. Many debit cards also charge foreign transaction fees and international ATM fees. But having a debit card while abroad is important, as it will allow you to get cash when you need it, which is far cheaper (and safer) than converting money at airports or banks. So make sure to bring a Visa or Mastercard debit card with a low international ATM fee and no foreign transaction fees when you head out of the country.