This is a common issue with the 2.9. I have been through it several times with my own truck. Usually it leads me to replace the low pressure fuel pump in the tank. That pump acts as a stuffer pump for the high pressure pump located on the frame rail. Twice, however, it has actually been the high pressure pump that was bad.
It can also be the fuel filter (located in an almost inaccessable place on the frame rail, driver's side, under the crossmember for the trans.
If those things fail, try pulling the vacuum line to the fuel pressure regulator while the truck is running. If fuel spits out, the regulator is bad.
Next is on to ignition problems. Check all the grounds and connections on the coil. While you are at it, check ALL the connections you can find in the electical system. They often corrode, especially in hot humid weather. USe electronic cleaner to tidy they up. Check out or change the long coil wire. It tends to burn through. I protected mine somewhat by adding a longer piece of that hard plastic wire wrap to it, (don't make it fit snug, leave some air gap). Pull the cap and check the cap and rotor. Likely, especially if you have the less expensive aluminum towers, they will be corroded past repair. Replace them with good parts that have copper terminals. Spark plug wires don't last forever either. One additional thing, many people say that they have issues with certain plugs firing correctly in the 2.9. I have had success with the Bosh Platinum, while others say their trucks simply won't run with them. Motocraft double platinum are a good choice. I would stay away from Champion.
Next on the docket is the type of oil you are running. This can affect the valve lifters and cut down on power when they rattle and stick. I run full snthetic and it has done wonders for my engine. NEVER run a Fram filter - they are junk. Just cut one apart and look at it to see that I am not lying. The STP (Deutz) filters at AutoZone are not too bad for the money. Motocraft, Wix, Napa, Mobil 1, are all good as well. Pennzoil and Quaker State dino oils have proven to be troublesome to me. I did tests in an oil lab and would never recomment them to anyone! For dino oil, I use Valvoline, or Havoline, for syntehric, I use Valvolene, Castrol, Redline or Amsoil.
Finally, are the computer sensors on the engine. Start with the throttle postion sensor. It determines how far the throttle is opened. They often fail. Next is the IAC (Idle Air Control valve) located on the side of the Intake. They do not often fail, but can get filled with oil crud from blowby. Clean them with carb spray on the inside by unbolting them and spraying and soaking. Check the relays on the fender well. The fuel relay can go bad, and cause all sorts of mischeif. It can be hard to detect, but changing it can make all the difference in the world. There are several others sensors, oxygen, etc, that can and do go bad. WIth all computer controls, it is critical to understand which ones are truly bad, as they get costly. Run the codes to determine which ones are bad before wholesale replacement.
If you do all those steps and it still doesn't run right, you likely have an intake air leak and will have to re-do the gastkets.
Best wishes... it can be an ardous journey.