I had no idea how to obtain a visa before I left on my world trip. It is really pretty simple once you know the requirements of the country you are trying to enter. I had to get a visa for Brazil, Australia (purchase on the internet), Laos, Vietnam, and Cambodia. A visa can range any where from $20-$100 US Dollars. It is basically just a tax to enter a country
A visa is required upon entering certain countries around the world. Depending on your nationality you can enter a certain country without a visa. Some countries do require that you have a visa to enter the country though. To know what countries require visa's you can visit your country's state department web site. For American citizens you can visit the State Department website. Each country will have different requirements you need to provide in order to obtain a visa. I would highly suggest that you to have extra passport pictures with you before you leave on your trip. You can just keep this in your bag and use it as needed. American's don't have a "free" pass to every country. I think the best passport to travel on is a New Zealand passport. They almost need 0 visa's enter every country.
There are two ways to obtain a visa while traveling abroad. The easiest and cheapest way is to go to the Embassy of the country you are trying to enter. Most countries have their embassy located in a capital of another country. (Some countries don't have an embassy in every country so you will need to check.) For example, if you are already in South America and traveling into Argentina, you do not need a Visa to enter Argentina as an American citizen. If you are trying to enter Brazil you will need to obtain a visa before you arrive at the boarder. So you would go to the Brazilan Embassy which is located in Buenos Aires. You will then drop off the required documents (Monday through Friday only), give them your passport, and pay a fee (tax). In about 24-48 hours you will be able to return to pick up your Visa that is now attached to your passport. It is as easy as that.
While traveling through Asia you can obtain a visa at the boarder of some of the countries you are trying to enter. You can do this at the boarder of Laos and Cambodia (do not need a visa for Thailand). You will have to get a visa for Vietnam before you get to the boarder (you can do this in almost any city in Thailand, Laos, and Cambodia). You will just need to have the items they require and fill out the information right there at customs. It will take about 20-30 minutes in order to complete the visa. It is always easiest to get your visa's done before you go to the boarder just to make sure that it is done, and that there is no problems. You never know what will happen with custom officals!
Some tourist companies or hostels also help you obtain your visa's for a fee. You actually hand over your passport to these people and in about 24-48 hours you will have your visa's. It is scary to handover your visa to a stranger, but I did it along my travels and had no problem. This is definitely the easiest option, but a little bit more expensive due to paying the extra fee for the service!