You can get owners manual here: 2004 Ford Ranger Owner?s Manual & Maintenance Guides | Official Ford Owner Site
I think the 2004 4.0l SOHC was past the timing chain issues that plagued earlier 4.0l SOHC engines, 1997-2002, and that was usually described as a rattle more than a tick.
Just FYI Rangers had 4.0l OHV engines from 1990 to 2000, in 2001 Rangers got the 4.0l SOHC, it is a completely different engine than the OHV.
SOHC does use rockers so valve train noise is possible, but not like it is on OHV engine using lifters.
Ticking could be a fuel injector, they can be quite loud.
If you get a small diameter hose you can use it like a stethoscope to check each injector while engine is idling.
Also with engine cold, loosen serpentine belt, remove it from crank pulley, and start engine, you can run cold engine for a few minutes without water pump.
This will do two things, first if noise was coming from an accessory pulley it will be gone now, so you will know where to look.
Second, it will be much quieter in the engine bay without fan spinning, so you may be able to localize ticking noise.