To create our list, the realtor.com data team first ruled out countries that have extremely restrictive policies on foreigners buying property.
There isn't a lot of real estate right on the beach, but there are a number of affordable nearby villages.
InterNations named Mexico the third-best destination in the world for expats in 2017.
In Port Dickson, a coastal town with a population of nearly 120,000, you can still get a beautiful beach home at a reasonable price.
If you get a 10-year visa, common among foreigners working in the country, you can buy homes for around $127,000.
Sunny Beach (Bulgaria) Bulgaria population: 7,084,571 Coastline length: 354 kilometers Sunny Beach is a formerly notorious resort located on the coast of the Black Sea.
La Concha Beach (Spain) Spain population: 46,354,321 Coastline length: 4,964 kilometers Relocating to a foreign beach town often means living in a remote location.
That may have helped it to be ranked the second-best destination in the world for expats by InterNations.
Costa Rica is very friendly to Americans buying property.
When it comes to foreigners buying property, they have the same opportunity as locals in most parts of the country.