Q: "What's involved with marrying a foreign national who it turns out is in the United States without any type of visa?"
A: This depends on the critical issue of whether the person entered the US with inspection (ie, did not jump the Canadian or Mexican border). If the person flew to Canada or Mexico and drove thru the border without inspection (ie, no visa or stamps in passport and no I-94 card) then marrying a U.S. citizen will not help that person in obtaining a "greencard" here. However, if the border jumper was the beneficiary of an immigrant petition that was filed on or before April 2001, then that person may apply for a greencard here by paying a $1000 penalty.
On the other hand, if the person did enter the US with inspection, meaning they have a visa in the passport and received a stamped I-94 card, and simply stayed in the US longer than the expiration date on the I-94 and perhaps worked without authorization, then marrying a US citizen will lead to a greencard, absent any negative factors or other issues of inadmissability.
Q: "Lets say a US citizen wanted to marry a Chinese national already living in the US (presumably illegally - no visa).
1) Without a valid visa, could the marriage even take place in the US?"
A: Yes, a visa is not required for a valid marriage in the US.
Q: "2) To straighten-out the immigartion status, what course of action might be taken?
Would the Chinese national maybe need to be returned to China to then await approval of a proper visa, so she can then return legally into the US?"
A: If the person is married to a US citizen, then that US citizen may immediately begin the greencard process for their spouse. The person does not have to leave the country...in fact, I would strongly advise against leaving the country because of the penalty known as the 3/10 bar. The 3/10 bar is triggered when a person leaves the U.S. such that if the person overstayed more than 6 months and less than 1 year AND leaves the US, then that person cannot return to the US for 3 years. Likewise, if the person overstayed more than 1 year AND leaves the US, then that person cannot return to the US for 10 years. Note the key factor is the person's departure from the US. My clients in similar situations usually receive their greencard status within 6 to 9 months of filing.
OTHER IMPORTANT CONSIDERATIONS:
If the Chinese national is a prostitute, and has any arrest records for being a prostitute, this may cause their greencard application to be denied. For this reason, I would perform an FBI criminal background check on the applicant to make sure their record is clean BEFORE applying.
Further, please note that the BCIS (formerly INS) presumes every marriage that is less than 2 years old at the time of filing for the greencard to be a sham/fraud marriage. Hence, the applicant has the burden of proof in demonstrating that the marriage is bona fide and was not entered into solely for the purpose of getting a greencard. It is not that difficult proving to the BCIS that the marriage is real and bona fide, however, it must be done in a very particular way.
LEGAL DISCLAIMER: The information provided in this post is for general informational purposes only and should not be relied upon as legal advice. If you have any questions, please consult an attorney, or you may contact me for a free consultation.