I have a friend who bought a refurbed iMac with a similar problem and Apple repaired it. I diagnosed it as a fan noise and they thought it was the optical drive. It turned out to be the fan. - GDF
The "ticking" sound might be the fan wobbling slightly and possibly hitting something. Sometimes moving the fan at higher speeds causes the wobble to stop. Might even be bad fan bearings. But, give the compressed air a try first.