To beat the rap means to evade conviction and punishment for a crime. Example: The lawyer helped John beat the rap after being caught by the police.