Begin by playing the rap song with the bars you wish to count.
Play it all the way through, if necessary, to get the feel of it.
Notice that there will be a strong beat followed by softer ones. The strong beat is called the downbeat. This pattern will usually repeat throughout the song. Each one of these sections is called a phrase.
Play the song again.
Count "1" each time you hear a downbeat this time.
Count "2" each time you hear the next beat and so on. Therefore, each measure will be counted as 1-2-3-4.
Clap along with your count to help you keep the rhythm.
Try counting for a third time. This time change the counting structure. On the first measure, when the song begins on the first downbeat say 1-2-3-4. On the second downbeat say 2-2-3-4. On the third downbeat say 3-2-3-4 until you get to the end of the song or verse if you are only counting the verse, which is likely your goal when counting rap bars.
Write down a scratch line or other simple counting system on a piece of paper each time you start another measure.
Count your scratch lines at the end of the verse. You will usually come up with 16 or 32 for the verse and 8 or 16 for the hook. This is the number of rap bars.