Hey my truck was doing kindof the same thing. My problem was a faulty fuel pressure regulator. but it could also be that your fuel pump is going out. Sorry not more help. If it is a fuel pressure regulator, it only took me ten minutes to change.

Later