In Game of Thrones, who had the right to claim the throne after Robert's death?

Joffrey was the king's son, so that inheritance makes sense. But Stannis was also Robert's brother, so that inheritance also makes sense. Is there no definitive answer, no word of law that declares who had the right to the throne?
4 answers 4