When traveling between Spain and Italy by rail, you will always have to pass through France. Therefore, you should make sure that your Eurail Pass is valid in France. If your pass is not valid in France you must remember to buy a separate ticket for this part of the journey.