Forget the foam and caulk. Try using a universal spout kit.
The hardest part will be getting the old spout off. It either is threaded on to a 1/2" or 3/4" male stub or it is held on with a saddle type clamp and O-rings over a 1/2" pipe.
To unthread turn the spout counter clock-wise.
If it will not turn use a mirror or take a pic with your phone of the underside. You will see an opening with a screw (usually Allen head).
You need to loosen the screw quite a bit and then try to turn the spout and pull at the same time.
Once off refer to the instructions included with the kit to reinstall the new spout so that it fits to the wall with no gap.
Once you do this you will be amazed at how easy it really can be. You also can brag to your neighbors.