Sparks inside a PC (other than inside the PSU itself) is pretty rare because it takes a large "difference in potential" (high voltage) to cause voltage to arc (jump or spark) from one conductor to another and there is only 12V inside a PC (again, excluding the PSU itself). It typically happens when a card, connector or other device is not fully or properly inserted in its socket or slot, exposing one contact point to another.
It may be the two memory slots, but I suspect it is the memory controller for those slots that was damaged.
Since this is a 4 year old computer, I think if me, I would start budgeting for a new computer in the near future - perhaps with tax refund - if any. For sure, I would perform regular backups of your data, starting today.