These clicking noises often come from the hard drive and may indicate that the hard drive is dying.
First, make a backup of your data with Time Machine or Carbon Copy Cloner onto an external drive. Then, open Disk Utility (in /Applications/Utilities), choose Macintosh HD in the sidebar, and verify the disk. What does it say? Also, you can check the SMART status in Disk Utility, selecting the hard drive at the top of the sidebar and looking at the bottom of the Disk Utility window.
If it tells you that SMART has failed or that the disk is damaged, take the iMac to an Apple Store or reseller to get the hard drive replaced