beat the rap, Slang. to succeed in evading the penalty for a crime; be acquitted:

The defendant calmly insisted that he would beat the rap.

18.

take the rap, Slang. to take the blame and punishment for a crime committed by another:

He took the rap for the burglary.

Origin

1300-50;1960-65for def 8;Middle Englishrappen (v.), rap(p)e (noun); akin to Swedishrappa to beat, drub, Germanrappeln to rattle; senses “to talk,” “conversation, talk” perhaps of distinct orig., though the hypothesis that it is a shortening of repartee is questionable

Slang meaning "rebuke, blame, responsibility" is from 1777; specific meaning "criminal indictment" (cf. rap sheet, 1960) is from 1903. To beat the rap is from 1927. Meaning "music with improvised words" first in New York City slang, 1979 (see rap (v.2)).

"talk informally, chat," 1929, popularized c.1965 in Black English, possibly first in Caribbean English and from British slang meaning "say, utter" (1879), originally "to utter a sudden oath" (1540s), ultimately from rap (n.). As a noun in this sense from 1898. Meaning "to perform rap music" is recorded by 1979. Related: Rapped; rapping.

rap definition

A form of pop music characterized by spoken or chanted rhymed lyrics, with a syncopated, repetitive accompaniment. Rap music originated in the second half of the twentieth century in black urban communities. (See alsohip-hop.)