Ideally, I try to avoid narrow roads altogether. I go out of my way for good shoulders or bike trails. Sometimes I use narrower roads with light traffic.
If I must use narrow roads with heavier traffic, I usually stay as far to the right as I can. Sometimes I do take the lane if the traffic is quite a distance behind me. Taking the lane tends to cause the cars that are quite a ways back to tap their breaks and at least slow down to the speed limit. Then, when the cars are closer behind me, I go over to the side to let them by.
I watch the traffic behind me carefully. Take the lane when the traffic is farther back so it slows down, then go to the edge as the traffic is right behind and going past.
That's how I do it at least. Seems to work pretty well.