Qatar issues a visa on arrival at Doha's airport to passengers who are citizens of Andorra, Australia, Austria, Belgium, Brunei, Canada, Denmark, Finland, France, Germany, Greece, Hong Kong, Iceland, Ireland, Italy, Japan, Liechtenstein, Luxemburg, Malaysia, Monaco, Netherlands, New Zealand, Norway, Poland, Portugal, San Marino, Singapore, South Korea, Spain, Sweden, Switzerland, UK, USA and Vatican City. The price is QR 105, payment by credit card is accepted, and grants a 30 day stay.
Citizens of GCC countries: Saudi Arabia, Kuwait, Bahrain, Oman and United Arab Emirates do not need a visa to enter Qatar.
For other nationalities, visa procedures can be complicated, as you will need a guarantor on the Qatari side, either a company or a government entity. Also Qatari embassies, unlike those of most other countries, are not entitled to issue visas, so someone in Qatar will have to file the application for you. 4/5-star hotels offer full visa service, for a price, if you book a room with them for the duration of your stay. Qatar Airways can arrange the hotel and visa for you, tel. +974 44496980. In this case, there also seems to also be a new regulation in place 2008 to either present a credit card or QAR 5000 at the point of entry - which should generally not be a problem, if you can afford the room. When booking with other hotels, you'll need a guarantor in Qatar.
For longer stays, visas must be arranged by having a sponsor. Unmarried women under the age of 35 will have a hard time in procuring a visa for a lengthy stay, as the country seems to fear that their safety and well being cannot be guaranteed.
You can travel to Qatar by bus from/through Saudi Arabia, there are fixed bus routes, within Qatar, although mostly used by men only. However, customs can take up to 4 hours especially at night. You will not be treated nearly as well as if you fly into Doha. Flying in costs only slightly more than a bus ticket.