2005 dodge ram not getting gas

i was driving the ram the other day and about four miles from home after accellerating after stopping at a traffic light the car the truck made an intermittent banging noise boom… boom… boom and woulg not go more than twenty miles an hour even though the accelerator was to the floor. I was finally able to pull over into a parking area after about three miles and as I did so everything returned to normal. I was able to then drive home another mile or so including up a long steep hill without a problem except for one little hesitation that really was nothing. hoping some one has an inexpensive solution for me. The truck has 280000 miles on it.

Have the fault codes pulled when you have your fuel pump pressure tested. That would be a good start. Have them take a look at the TPS while they are at it if your vehicle has one.