I am assuming that the person has no immigration status in the UK but the answer will be the same if they do have temporary status.
At present, in order to marry in the UK unless you either have Indefinite Leave to Remain or are a British Citizen, you need to apply to the Home Office for a certificate of approval. This is a free of charge application where you need to complete form COA available on the Home Office website and then submit it.
If the person has no leave or has less than 3 months remaining on a their visa, you will need to also submit affidavits about the relationship from both parties in order to 'prove' to the Home Office that your relationship is genuine.
If you have more than 3 months remaining on a visa that was granted for more than 6 months then you can simply complete the form and submit this to the Home Office along with your passports and passport photographs. Each person that does not have settled status will need to apply for a certificate of approval.
However, if you are planning to marry in an Anglican Church then a certificate of approval is not necessary. If you plan to marry anywhere else then currently, it is.
It can often take months for the Home Office to make a decision on them and even once they are issued, you only have a window of 3 months in which to marry.
They are however planning to scrap the certificate of approval scheme and this should be brought into effect in Spring 2011. See this news feed from the Home Office for details http://www.ukba.homeoffice.gov.uk/sitecontent/newsfragments/32-coa-changes and so your other option is to wait a few months and see whether they abolish the need for one. It does not appear that they are going to replace it with any other scheme so it will make life a lot easier. They haven't released any more detail than this at the moment though so it's up to you how long you want to wait.
It should be noted that a certificate of approval will only give you permission to marry in the UK. It does not confer any leave at all and a separate application will need to be made for that which most likely will carry a fee.