From RCW 41.61.770, emphasis mine:
(1) Every person operating a bicycle upon a roadway at a rate of speed less than the normal flow of traffic at the particular time and place shall ride as near to the right side of the right through lane as is safe except as may be appropriate while preparing to make or while making turning movements, or while overtaking and passing another bicycle or vehicle proceeding in the same direction. A person operating a bicycle upon a roadway or highway other than a limited-access highway, which roadway or highway carries traffic in one direction only and has two or more marked traffic lanes, may ride as near to the left side of the left through lane as is safe. A person operating a bicycle upon a roadway may use the shoulder of the roadway or any specially designated bicycle lane if such exists.
(2) Persons riding bicycles upon a roadway shall not ride more than two abreast except on paths or parts of roadways set aside for the exclusive use of bicycles.
So the law in the State of Washington says that people on bikes should ride as far right “as is safe”. From what I understand, this is a very common rule. In Oregon and some other states they use the word “practicable” instead of referring to safety, but the basic intent is the same. Yet I and many other cyclists routinely “take the lane” in Seattle traffic, and I at least believe that I'm operating fully within the law when I do so. Recently when riding on Market Street in Ballard the driver of a purple Prius started behind me, correctly made a lane change in order to pass me, then encroached on my position from the side, in a deliberate attempt to force me out of my position. I approached her at the next intersection and she yelled at me not to take the whole lane. As it seems to be a common driver sentiment that bicyclists shouldn't take the lane, I'm going to make the case here that in many cases such as this, the center of the lane is the farthest-right safe place I can ride.
So we'll start at the right edge of the lane. On this stretch of Market Street, as on most major streets in Seattle, there is street parking along the side. This means that at least the right-most few feet of the lane are unsafe for biking. Certainly, nobody would try to drive a car that close to the parked cars, and I won't do it either. I will almost never use this part of the lane to pass between parked cars and those stopped at a stoplight, because passing cars on the right is one of the best ways to get hit; many cyclists will, and they seem to prove me right in a steady stream of mauled frames.
But aren't most bike lanes on the right edge of a lane, squeezed in next to parked cars? They sure are! Most bike lanes are narrow enough that you can only really ride toward their left edges to be out of the door zone. Some vehicular cyclists avoid bike lanes entirely for this and other reasons, but I think riding in bike lanes works OK most of the time. Because of the proximity to parked cars, I limit my speed and ride near the left edge of the lane. Bike lanes aren't really the interesting case here, though.
Just left of the door zone, on streets like Market, is the “right-wheel path”, which is, clearly enough, the path traced by most cars' right wheels. On the typical poorly-maintained Seattle street the roadway sags around cars' average wheel paths, so they're easy to follow. I see lots of people biking near the right-wheel path. But on many roads I think it's a bad idea. The problem is that usually there's almost enough room left in the lane for a car to pass within the lane but not quite enough. This invites a number of behaviors from passing motorists. A common one is passing within the lane, too close for comfort. Another is drifting partially into an adjacent lane to make the pass. The problem with this is that drivers often don't take the proper precautions when they do this. This means you're at risk of having a driver swerve right at you after realizing he's about to hit someone in the other lane. If the driver needs to make a partial lane change, he needs to make a full lane change.
The smallest distance left you can move to avoid these pitfalls (which are very real, in my experience, and in that of many others) is into the middle of the lane. Therefore, the middle of the lane is the farthest right I can safely ride on many streets.
This might sound unsatisfactory to drivers. I'm just going to ride right down the middle and not let you pass? Well, that's exactly what I'm going to do on Market. That's because it's a four-lane road and you can easily pass me in the left lane the way you'd pass anyone else. Two-lane roads are more of a problem. In Washington there doesn't seem to be any law preventing me from doing this, but I prefer not to piss people off. So if I'm going downhill or can otherwise keep up with traffic, I'll ride down the middle, and it doesn't cause any trouble at all. Going uphill I try to choose routes with bike lanes, without street parking (many two-lane roads without street parking have wide enough lanes that I can ride the right edge safely), or side streets without much traffic. Sometimes (as on my route to work) I take the lane on a two-lane arterial, but I try not to do it for long (on my route to work, I do it for one block. Oregon has a law that slow-moving traffic (including bike traffic) on two-lane roads has to pull off and yield to faster drivers; Washington, as far as I can tell, doesn't. But if I have to be on a narrow two-lane road for a long time I'll pull off and let people pass every now and then, just like I'd let the crazy speeders by while driving on two-lane highways in Wyoming and Montana.
For what it's worth, Purple Prius Lady doesn't stand in for all drivers in her actions (very few drivers actually use their cars to threaten people). But her anger at cyclists taking the lane, even when it's legal and the safest way they can ride, is all too common (many drivers honk and yell at me). My first priority when I bike on the road is my safety, and I won't compromise it by riding in unsafe lane positions. If you didn't know that, now you do. If you do know that, and still want to get angry at me (despite that the vast share of traffic backups are in fact caused by other drivers, not cyclists, cyclists take an incredible amount of abuse on the roads), you're probably beyond help.