How does a jet engine handle suddenly entering a lot of rain?
In another question there is an excellent answer for how thermal expansion is handled in a jet engine.  It's an established fact that jet engines can handle fast temperature swings.  Have you watched how fast an ITT gauge goes up when starting an engine? My answer will focus on rain's effect on a jet engine.

The first thing to understand is that jet engines take a lot of air. That's why they can handle bizarrely heavy rainfall or even water on the runway splashing into the engine from the tires (this water jet has the fun name "rooster tails"). The Airbus 320, for example, goes through 27,000 liters of air every second during takeoff. 2 That means even during rigorous FAA certification testing the concentration of water ingested never gets higher than 20 g of water for every cubic meter of air.  See FAA Part 33.78 Appendix B 

In order for you to understand why the water has little cooling effect I have to describe what happens when an engine takes in water, assuming you know the basic parts of a jet engine.  The air/water mixture enters the compressor, and the fan blades in this compressor are spinning rapidly enough to catch a lot of the water and like a centrifuge this water is spun towards the walls.  This helps prevent water from entering the combustion path on a bypass engine, but it does not prevent water from following the gas path, especially on an engine with no bypass around the gas path.

The engine must now adjust for the extra water in the air, and engines are very good at adjusting for these kinds of changes in conditions.  If there's more than one independent compressor rotor, for example, the rotor speeds will change to keep the air moving smoothly and ensure a correct pressure drop across the compressor, called "compressor rematching."  The engine will also increase the fuel to air ration to compensate for the water.  These two processes evaporate the extra water through thermodynamic heating, not through heat transfer.  In essence, the first stages of the engine are providing the extra energy to evaporate the water, so little differential cooling occurs, even if the amount of rain is rapid.

One thing to note here is that the engine actually runs hotter than normal instead of cooler than normal during these events, due to the reasons noted above as well as the extra thrust provided from the water injection. 

All the parameter changes noted above reduce your margins for engine flame out and compressor stall.  In practice, an engine should flame-out or surge before water can cause a big enough thermal change to cause engine damage.  If you think about it, the amount of temperature change needed to cause a problematic warping of an engine should be a lot more than the amount required to cause the engine to quit running.

So we've established that jet engines are good at expanding and contracting due to thermal changes.  We've also established that relatively speaking we're actually not talking about a ton of water here, just a few grams per cubic meter of air, which would take a small percent of the engine power to evaporate (~1% by my calculations). Most of the extra water is evaporated not by cooling down engine parts, but by making the early stages of the engine work harder.  Finally, the reduced margins caused by water intake mean that you'll surge or flame-out before you get to warping engine parts.  These principles should apply regardless of whether the water ingestion begins in a matter of seconds or ramps up over several minutes.

In conclusion, in "Investigation of Engine Power Loss and Instability in Inclement Weather,"(pdf)  the FAA noted "Engines typically are not damaged during a heavy rain encounter. Usually the most severe situation is to experience multiple engine flameout or surge with a subsequent pilot initiated engine shutdown."  The report then went on to note that the two incidents where engine damage had occurred from rain were over-temperature events, not from differential cooling.  So your biggest worry when flying through even storm-of-the-century rainfall should not be whether your engine will warp from rain cooling things down.