At about 1440 Pacific time, the airplane experienced an uncommanded retraction of the right flap while on the downwind leg for landing. The commercial pilot and two medical flight crewmembers were uninjured; the airplane was undamaged. Visual conditions prevailed. About the time the flaps reached their maximum limit, the pilot heard a popping sound, and the airplane simultaneously rolled about 80 degrees to the right. He counteracted with full left aileron, retracted the flaps and applied full engine power. On attaining a positive climb rate, he retracted the landing gear. He was only able to maintain a wings-level attitude with full left aileron control input. While circling, he was unable to extend the right flap or retract the left one. After diverting to a nearby airport, the pilot subsequently landed the airplane. Examination revealed the right-hand upper flap control cable was severed under the cabin floor.