Wiktionary
beat the rap
vb. (context slang English) To escape legal conviction and punishment for a crime which one has been been charged with committing; to be acquitted.