Push the sunvisor up when the rattling sound occurs. See if that eliminates it. My sunvisors vibrates a bit against the headliner when they're in the up position and it rattles at a weird frequency. Almost like a hum. I leave them down (like I prefer at all times) anyways.
Also, have you...