Gummy residue from baking spray/oil
When oil gets overheated, it turns into a polymer that is insoluble in water, even with soap.

The best way to clean this up is with Barkeeper's Friend, Bon Ami, or a similar solvent (I think they're all alkaline-based solvents). It's non-abrasive, and safe to use on almost all cookware without leaving marks.

Edit: To help prevent this from happening in the future, use a paper towel to wipe off any excess baking spray on the edges of the baking dish that won't be covered by food.