Rhythm and blues is a term which has had many meanings and covered many genres over the decades. Originally, it was simply a new name for "race" music in the 1940s, but as popular music evolved, it came to describe a variety of black and urban music styles. The umbrella term of R&B would eventually cover early blues, jazz, soul, gospel, early rock and roll ("borrowed" by Elvis), funk and even disco.
Hip hop is a culture (e.g., dancing, clothing, graffiti) and genre of music that arose in the Bronx borough of New York City in the 1980s, with roots in the "yard dances" of Jamaica. It combined soul and funk music (with bass and beat being an integral part) with modern technology. It makes use of multiple turntables, "scratching" of vinyl records, "sampling" of other musical recordings, and beatboxing. The other main component of hip hop music is, of course, rap.
Rapping is a vocal style where the performer speaks the lyrics as opposed to singing them. It is a melding of poetry (in theory) with the technological components of hip hop. Rap is performed over a strong driving beat with moderate instrumentation. Historically, it can be traced to the rhythmic storytelling of Africa, early spoken blues music, and the beat poetry of the 1960s. But its modern equivalent began with disc jockeys who would improvise spoken lyrics while scratching and sampling.
Music historians consider true R&B to have ended after the death of disco in the 1980s. Around that time, the term "contemporary R&B" was coined to cover a blend of hip hop and pop music (with R&B influences). As the definition of music genres constantly shifts, however, "contemporary R&B" now refers more to popular and soul acts which favor melody and singing (from Michael Jackson and Whitney Houston, to Mariah Carey and Alicia Keys), and no longer encompasses hip hop and rap, which are viewed as their own urban genre.