The blistering heat that has baked Southern California for days is coming to an end, with rain on tap for the weekend and early next week, along with a risk of potentially damaging coastal flooding.