Usually a clicking, especially rhythmic clicking, is a sure sign of a dead, or dying, Hard Drive.
In this case though, I am not so sure.
Even with a dead HD, it should still be able to boot up from a CD/DVD and even get into Target Mode.
Having said that, I have know Macs to hang at boot just because of a faulty drive.
If you can get inside that thing, disconnect the HD and try to boot again.
Depending on what model you have, entry is either really easy or extremely difficult and best left to someone with insurance.
Lay the machine on its screen, protected of course, and look for three screws at the bottom of the screen. If they are there, you have the easy access. Undo them and lift the whole of the back, including stand, off the front.
If that works, disconnect the HD, put it back together and reboot with the CD/DVD. If it boots, you know where to go.
Google for instructions. The G5 iMac and, I believe, the early Intel iMacs. had the easy option. To change out the HD on a new model iMac, involves going in from the front! Remove Bezel, LCD and a bunch of screws.
Let us know how you get on
P
I am running 10.5.2 on an early 2006 1.86GHz Intel Core Duo 17" iMac (white), 160GB HD, 8x Superdrive, 2x1GB RAM.
1MB L2 Cache (from memory), bus speed 667 MHz (also from memory).
Latest BootROM (forget which one), checked for updates about a week ago.
Am, or rather was. It died this afternoon. I came back to it after lunch and the hard disk was making a distinctive pattern of clicks - a slow 1 - 2 - 3, which sounded like regular clicks and releases of a button, and then a short burst, followed by the 1 - 2 - 3 etc. The noises themselves weren't unusual, sounding just like ordinary disk access sounds, it was just the regular pattern that was distinctive, and the fact that none of my open apps were responding. I had been copying some files to the computer over the network and the copy had errored out with only a few files left to copy. Over the next 30-45 minutes I managed to force quit all the apps (about 7mins per program), but still couldn't shut down or restart, and ended up holding down the power button to switch the machine off.
I gave it half and hour's rest and powered it up, but it got stuck after the apple logo and the circle of spinning bars appeared (they were both still there). The hard disk made the distinctive pattern of sounds again.
The next time I started it, I tried zapping the PRAM, but the machine got to the same stage before powering itself down. Trying to boot into Safe mode or from my Leopard install DVD or in Target Disk Mode also failed. Every time, the Apple logo and the spinning circle of bars appeared, then the machine shut off, I presume before it can do any of those tasks.
I have tried taking each of the RAM modules out - same result.
I am not sure whether the problem is the hard disk, or the logic board or power supply, or something else entirely. I have heard on another forum that some iMacs went out with faulty capacitors on the logic boards and that you can check on Apple's website to see if your serial number falls into that range, but I can't find the page (search terms were intel imac logic board faulty capacitors power supply serial number, and variations thereof).
Recently I have installed several freeware and shareware apps from magazine DVDs, and had particular problems with Intego Fileguard. It creates 'safes' to encrypt folders you specify, though when I asked it to put my emails, pictures, movies and music in four separate safes they all became corrupted immediately. In the case of the pictures and music I lost most of the files (nearly all recoverable from backups/original CDs, thankfully!).
Also, just yesterday the machine had crashed after a restart, reaching the same point as it does now, but this time it didn't power off. When I powered it down and gave it a rest, it started up normally.
This is my first dead Mac, and I'm realising what a traumatic experience it can be. Help will be much appreciated!

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic