Could be piston slap, valves, or injectors. I think most common is injectors. I'm convinced I quieted my injectors down when I cleaned them, as they don't make any noise at all now.
I'm working with a friend who has determined that his truck's ticking noise is from noisey injectors. He is goint to clean his injectors as I did and see if it quiets down the same way.
I used two highly recommended products for cleaning varnish out of a fuel system, Schaeffer's Neutra 131 and Lube Control's Fuel Power. I ran the neutra by itself for a few months, then started mixing it with Fuel Power. I now add 2 oz of this brew every time I fill up.