I can give a little info as I was buying one a few weeks ago. Dealing with an auto store and the Dealership, all the Ranger assemblies are the same between years (2003 3.0 fits a 2003 4.0). I think 2001 - 2003 is the same and it definately changed in 2004.
2003 is a wierd year. Its like the parts interchange guy had an off year. The spark plug wires are the same, yet they are listed as a separate item from Ford. The same may apply to the fuel pump.
Also, using motorcraft.com to look up parts is beneficial. Once you find the part, hit the BG box. It will list all the other vehicles by year/engine/make that have the same part.
2004 Ford Ranger Sonic Blue 4dr 4x4 4.0 Manual