I've used ColorBrewer[0] in the past for this purpose. It's got some great options for ensuring the colors are distinguishable by people with varying forms of colour blindness as well as in black and white. That last one is a big one because it's a pet peeve of mine when figures are unreadable in a printed paper.
I've used the method described here [0] of simply incrementing hue by the golden ratio. You can generate dozens of colors that go well together yet are quite distinguishable.
I haven't tried this, but it seems like just incrementing the hue would mean colours would be difficult to distinguish when printed in black and white.
D'oh! I think you're right. In B&W these would be identical. I think one could use the same trick with lightness in this case, rather than hue. Still, colors generated that way are going to look like ass on a screen. It seems like you're already doing media queries, though, so doing two variations of this technique wouldn't be too bad...
http://colorbrewer2.org/#type=sequential&scheme=BuGn&n=3