Oedipus becomes the ruler of Thebes after solving the riddle of the sphinx and in the process , marries the widowed Queen , his mother Jocasta . He becomes the ruler of Thebes after solving the riddle of the sphinx and in the process , marries the widowed Queen , his mother Jocasta .