Hundreds of thousands of people have been forced to flee their homes as France and Spain battle raging wildfires.