When I was on my way back from Colombo to London via Qatar, I had a lot of questions concerning the stopover there, most of which I was unable to find answers to online. So now that I've done it, I'm putting a bit of what I learned out there so hopefully others will be helped in the future.
I flew, not surprisingly, Qatar Airways, which was a reasonably nice airline. On the way over I had a very short connection, but they not only held the plane when we were late but managed to get my luggage transferred.
On the way back I had almost 6 hours on the layover, so I debated trying to go out and see some of Doha. The rule is that if your layover is 8 hours or more, Qatar Airways will sponsor a visa for you, otherwise you have to buy one. The good news is that it's extremely easy and fast to buy one (at least with a US passport) -- you can pay with your credit card, and it's only US$28. I had read online that the airport in Doha is awful and you shouldn't spend any time there - it's not THAT bad... I've definitely seen worse. The ground floor is a huge duty free store with everything you could imagine, and there is a pretty pathetic food court upstairs.
But then again, the airport is 10 minutes from the city center, so there's no real reason not to leave. My plan was to take a taxi to the Sheraton, which is at the far end of the Corniche (the walkway next to the ocean that everyone advises you to walk down as part of your tour) and to walk back. The taxi was easy to get and cost me 30 riyals. However, I feel compelled to say that the walk back was not the best use of my time, despite being the number one attraction all guidebooks and other tourists told me to see. The end near the Sheraton has some big and modern buildings (much like the other big Middle Eastern cities), and there are a few things to see here and there, mostly a reasonable - if smoggy - view of the skyline, but it's a long walk and Qatar is hot. I mean at 7 am on a July morning, it was probably above 100 degrees already... so it took me a long time to walk, there's not much water available, and I ended up exhausted.
I walked as far as the pearl monument and dhow harbor, which I suppose are nice for a photograph, but I think I would recommend that you start there and forget about the rest of the Corniche. From here it's a short walk to the Souk Waqif, a big winding market that has been restored so it's in really good condition but looks old (I mean it IS old, and they've been careful to retain the old style despite the renovations). It's a good place to see Qataris in traditional dress and lots of shops stuffed full of all kinds of miscellany.
It can be difficult to find a taxi back to the airport - I managed to find one on the street and I was told there is a taxi stand somewhere around the souk. I actually ended up going back to the airport early because I was dangerously close to heatstroke, and the airport is blissfully air conditioned. Getting back in through security and customs was quick, so there was definitely no problem with my plan of visiting the city even with such a relatively short layover.
For what it's worth, I am a woman and was traveling alone, and not only were there no touts or anyone to harass me as a tourist, but I didn't feel any more danger as a woman than I do in any developed country. People generally left me alone.
At the end of the day, I found the part of Doha I saw to be relatively characterless and not particularly attractive, though the souk was kind of nice, and I was interested by all the people dressed in traditional costume (and tried not to be upset by the women with nothing but their eyeballs showing), though in fairness you can see this at the airport too. Who can say if I'd have a different opinion if I had a longer layover or was there at a different time of day, but for now my recommendation is that you might as well go into town if you have a 5 or 6 hour layover (or longer) but I certainly wouldn't pick Qatar as my primary vacation destination.