the beat is owned by another artist but you create your own lyrics.
Trademark Application Attorney
This has been asked before, actually. If I understand what a beat is--and my favorite composers died decades or centuries ago—they are copyright protected, even if not registered. Using them is likely to be a Copr. Infringement, maybe even two. If you re-create the beat it is one, but if you actually copy the beat from a “phonorecord,” then you add infringement of a performance. The only defense I can think of is sincere satirizing of the original song, but that is not what you are planning, is it?
Get (buy) a license or do not do this.
Licensed in Maryland with offices in Maryland and Oregon. Information here is general, does not create a lawyer-client relationship, and is not a substitute for consulting with an experienced attorney on the specifics of your situation.
Trademark Application Attorney
If you are planning to publicly perform the "beat" with your own lyrics, even without recording the resulting song, this will amount to infringement. As my colleague mentioned, if you are trying to parody or satirize the beat, your performance may protected by the fair use doctrine.
Intellectual Property Law Attorney
Since you are new at this and need a license, probably two, and you don't know what they are, I suggest you shortcut the process and hire Music Bridge to get your licenses. www.themusicbridge.com
I am not your lawyer and you are not my client. Free advice here is without recourse and any reliance thereupon is at your sole risk. This is done without compensation as a free public service. I am licensed in IL, MO, TX and I am a Reg. Pat. Atty. so advice in any other jurisdiction is strictly general advice and should be confirmed with an attorney licensed in that jurisdiction.
Communications & Media Law Attorney
Interesting question. If the venue where you are playing the beats has a public performance license (ASCAP/BMI), that would seem to cover the playing of the beats recording in the venue. You are then just adding your lyrics, and the resulting live performance is not being fixed in a tangible medium. So you may be alright. You will need to do some further legal research to confirm this. I am curious if my colleagues have any thoughts about this possibility.
No attorney client relationship is created with this post and no legal advice has been rendered. This is for general informational purposes only and does not apply to any specific set of facts which have been reviewed by me. The information contained in this response has not been verified and is not necessarily accurate or reliable, or applicable to any particular jurisdiction. Always hire a licensed attorney to represent your legal interests.
Contracts / Agreements Lawyer
In addition to the other good answers posted here, YES, it is legal so long as you are paying the appropriate royalties. David M. Slater has provided great comments about live performance, as to recording, you will need to cover royalties for both the songwriter and the recording.