If you are only transiting in a country, you might not have to apply for the full travel visa but only for short-term transit visa. Transit visa is usually valid only for 24 hours or few days and is faster and cheaper to obtain. The biggest advantage is that you may still be able to visit the city for few hours or days before continuing your trip and enjoy the benefits of the full transit visa.
The process is the same as applying for tourist visas. Simply choose the country you plan to visit to see if there is a specific transit visa and complete the online application form. It takes 5 minutes to apply and only passport and flight tickets are required usually. In few days, you will receive your approved visa via email.
The price of transit visa varies country by country, please check the visa details for your destination to find all details. However, transit visa is usually cheaper than standard travel visa and travel authorizations.