Did you looke under the hood with the engine running? Can you hear the noise/rattle? If its more prominent insid the car i would first check for things in the glove box or under dash......things left and forgotten long ago can rattle with the engine's vibration...

....has happened before. Is your A/c system on when the rattles come on...try turning it off an see.....could be the fan?