I use a visor on my helmet to help hold my rain cap on my bike, and (as Louis notes above) in heavy rain I wear a cap with a bill under my helmet. I started with a cycling cap - but in really heavy rain (like on day last week), I'll wear the longest-billed baseball cap I can find.