There is no specific offence of 'making racists comments in public'. In general, people are free to express their racist views openly and publicly.
Where a case might end up before the courts though is if the offender is guilty of "threatening or abusive words or behaviour or disorderly behaviour" in a racially-aggravated manner. (Section 5, Public Order Act 1986). An offender CAN'T be sent to prison for such an action; the maximum penalty is a fine of £2,500 (although, since fines are actually related to disposable income, most fines imposed would be much lower than that).
It's only the most serious offences of racially aggravated anti-scoial behaviour which can be successfully prosecuted under Section 4 of the Act. Such offences can lead to terms of imprisonment of up to 6 months if the case is heard before magistrates or of up to 2 years if the case reaches the Crown court. However Section 4 wouldn't be used against someone who simply made a few racist remarks. It would take, for example, a campaign of action by the offender against his victim to result in such a serious charge.