ill try to be as specific as possible. I’ve got a 2000 Toyota Avalon that just passed 177,000 miles and has an audible issue with the relay. When the car is off and the key is out of the ignition, it it clicks rapidly until I put the key back in. All I have to do is put the key in the ignition barely halfway and the ticking stops, but once it’s out, the ticking starts right up again. I took out the relay that was ticking and swapped it with the others right around it, but it keeps on ticking in that outlet no matter the relay. I’m hoping it isn’t the pcm but I wanted someone’s two cents before I went to the mechanic about this. The car runs like a champ and there’s no noise whatsoever once the keys is put into the ignition.
here's my 2 cents. It seems the coil on the control side of that relay is getting energized by a small short that isn't substantial enough to provide the current necessary to hold against the return spring in the relay so the relay "chatters".
The fact that it's directly related to the key being in or out makes the ignition starter switch the likely culprit.
It looks like this:

It lives on the end of the ignition lock cylinder where it's held on by 2 screws. Here:

You can remove the bottom dash trim (by the driver's knees), pop out the plastic heat/ac vent, and reach up there and replace the switch.
((you can find aftermarket ones pretty cheap))
Thanks for the in depth reply! I just got finished replacing that part just now but unfortunately the sound started right back up after a test drive as soon I hooked the battery back up. Could it be a corroded wire possibly? It just seems so strange that it stops right when the key barely touches the ignition.
I looked at your ignition barrel/cylinder a little closer
.
If you remove the cylinder
.

.
You'll see this little pintle sticking into the cylinder barrel
.

.
It's part of the switch on the ignition cylinder barrel that opens/closes when the key is even slightly put in.
.
It looks like this on the cylinder barrel. I think it's called something like the Ignition Unlock Warning Switch
.
The thing is, I don't know if they sell those separately from the ignition lock cylinder
.
Instead of going through the task of removing the lock cylinder, maybe see if you can get to that connector from underneath and using a multimeter (Ohms scale) see if there's any continuity when the switch is supposed to be in its open position (by measuring with the key inserted, and then the key removed) and inspect both sides of that connection for wiring or corrosion issues that could be causing a small short
.
Click Image To Enlarge
.
It’s been a couple days since I’ve put the switch inside the ignition barrel in and the relay hasn’t ticked once! Thank you very much jack my mechanic couldn’t even figure it out.