"The forecast said it will rain" - e.g. today is 15th November, we saw/heard the forecast yesterday and it said it will rain on 16th November. So it is still in the future.
"The forecast said it would rain" - today is 16th November, we saw the forecast on 14th November and it said it would rain on 15th November. So both the forecast and rain were in the past.
Similarly with was/is going to rain.