A visa is a permit to ask for permission to enter into a country by crossing its borders. Since you are not entering the country; but rather overflying it - you only need to worry about any requirements for your destination.
Now, if you are doing a technical stop, and you don't leave your aircraft - then you don't need a visa. This is true for normal passengers on commercial flights as well.
If you need to leave the aircraft, but not leave the sterile area of the airport - then depending on your nationality you may need a special crew visa (this is different than the normal visa you would get as a passenger).
For crew visas, there are no uniform rules. Each country is free to set their own permissions and requirements so you'll need to contact the embassy of the country you wish to stop in for information.
God forbid you face an emergency and have to land at a country and you don't have or don't know the visa requirements - there are provisions for such cases. Emergency permission can be provided to cross borders.
In all cases, make sure you carry a passport that is valid for at least 6 months after your return date.