Last week I posted a similar article about a ticking/clicking that my '00 RAV's engine was making. I didn't get any replies, but the dealer was able to diagnose the noise for me, so here it is. On mine, the noise is the charcoal canister purge valve solenoid. Apparently the solenoids on some vehicles are just noisier than on others and there's no cause for concern. If you locate the solenoid, you can verify this with a stethoscope or just by pushing down on it with your hand--you can feel it vibrating in tune with the ticking noise.
Your rattling sound from underneath sounds more like a heat shield that could be loose, if it's a metallic rattling.
If you haven't already, I would suggest checking out
www.rav4world.com for forums and info dedicated to the RAV4.