It is possible that a contract written by a non-licensee could be valid, because the fraud and misrepresentation are not being committed by the principals to the contract (buyer and seller) but by one of their agents.
Perform due diligence to verify beyond a doubt that the person is not licensed. Ask them to provide their licensee number or correct spelling of their name so you can verify their licensing status. Tell them you cannot find their licensing information on the state Web site and ask for an explanation.
Once you confirm they do not have a licensee and do not fall into any of the exemptions to the licensing requirements you should contact your client and inform them of the situation. Second, tell your broker and make sure that he or she is aware of what happens. Third, inform the other party that their agent does not appear to be licensed.
Some of how you handle the situation is going to vary depending on the circumstances. Does your client want to consummate the transaction? Does your client want to run for the hills? Remember your duty is to protect and promote your client's interests, without breaking the law yourself.
If your client wants to keep the transaction alive, do the best that you can with the bad hand you have been dealt. If this is a case where an unlicensed assistant was doing the work of a licensed agent - have a stern talk with the other side. Your broker should contact the other agent and broker (both) and inform them that from this point on only licensed individuals will be dealt with. In addition, tell them that, if in doubt, you will be checking licensee cards.
If the individual is not affiliated with any firm or licensee, tell the other principal you don't want to lose your license by working with someone who is unlicensed. Inform the party using the non-licensee that you will only deal directly with them until they get a licensed agent to represent them. Remember that it is considered "improper brokerage of a commission" to pay someone who does not have a real estate license.
Finally, to protect the contract if your client wants to go forward, try to get a signed disclosure from the other party saying they
1) have been informed that the individual in question is not licensed;
2) have been advised to seek legal counsel or representation from a licensed individual; and
3) still wish to proceed with the contract.
This disclosure should significantly decrease the possibility of the party being able to get out of the contract because it was written by an unlicensed individual.