The music must first be 'Published' by a licensed company.
There are two principal licenseing agencies in the U.S. They are ASCAP (American Society of Composers and Publishers) and BMI (Broadcast Music Inc.).
The publishing company must be a member of one of these. As well, as a writer you should become an individual affilliate.
So, once that's all done here's the way it goes;
Users of music...Radio, TV, Movies, Clubs and any business that uses music for entertainment purposes must pay for the use of that music.
The user will make payments to ASCAP or BMI usually to both on a yearly basis to aquire the rights to play their licensed music.
This money goes in to a general fund and the composer along with the publishing companies are paid from that fund based on the realative popularity of the material.
Special arrangements are usually made for Movie productions.
Another item worth mentioning is the fact that you can start your own company for very little expense. This way when your material is used for broadcast you may keep both writers and publishers checks.
Google ASCAP and BMI for full details. You can also search for a generic writer / publisher contract. The contract will appear as a PDF file and is editable to fit your particular needs.