A well pump has a riser gas separator for removing large slugs of gas prior to reentry into the pump. The riser extends upward from a barrier that is located in the well. The riser has an inlet that is located above an effective intake of the pump. Well fluid must turn to flow down to the pump, with gas separating by gravity flowing upward while the liquid flows downward. The downhole assembly has various configurations to assure that fluid flows past the motor for cooling.