Thank you for using Just Answer here is the firing order for the 03 Ranger w/flexfuel, hope this helps you out. Thank you.
Here is another diagram basically it would be the view standing at the front of your vehicle looking at the engine.
Is the check engine light on?
What code was retrieved?
You may have a dirty Mass Airflow Sensor which can cause a misfire as well and I would recommend cleaning with either brake cleaner or specifically designed Mass Air Flow spray cleaner.
Double check the the plug wire connections making sure they click and you may have to pull the plugs again to make sure they are gapped properly. The gap is .044
If haven't done so already I would recommend taking off the IAC(Idle Air Control) and clean it out with some brake cleaner solvent spray and remove the carbon build up which could also cause the rough idle.
The IAC is located on the right front of the engine standing in front of the truck.