When riding the bus, I always start by putting my bag on the seat next to me. Then as the bus fills up, I watch for someone who looks relatively sane and like they have good personal hygiene. As they walk towards me, I move my bag, which almost always results in them sitting next to me. There's probably some subtle (or not so subtle) psychology behind this, but all I can say for sure is it usually works.
Of course the success of this plan also hinges on your ability to judge a book by its cover; after so many years of transit riding, it is something I'm quite skilled at already. Now I realize this type of behavior is generally discouraged in polite society, but I'm not picking a new BFF here, just trying not to sit next to a chatty Cathy who smells like a BO soaked ashtray.
(As you may have guessed, this protip is brought to you by a day on which I didn't follow my own advice and spent a bus ride sucking back stale cigarette stench. Yum.)