Typical culprits for this are the TFI module mounted on the side of the distributor, or the PIP module located inside the distributor. There are tests for these given in most shop manuals, so don't start shotgunning parts else you may have two problems to solve - the original problem and the problem with a potential faulty out-of-the-box part.
My experience with replacing the PIP module is that it's usually more time-efficient to just get a replacement distributor that already has the PIP installed. It's a real pain to get the distributor drive gear off without destroying something.
1989 F150 XLT standard-cab shortbed 4x4, 5.0L, AOD, 3.55 gears, manual hubs, 31x10.50 tires, 218K miles. Repainted Oct09. SOLD - Jan2015
2014 F150 XLT standard-cab shortbed 4x4, 5.0L, 6-speed auto, 3.55 gears, auto hubs, locking diff, trailer pkg, 3K miles.