The following is from IRS Source: http://www.irs.gov/charities/article/0,,id=96104,00.html
For most organizations, an activity is an unrelated business (and subject to unrelated business income tax) if it meets three requirements:
There are, however, a number of modifications, exclusions, and exceptions to the general definition of unrelated business income.
Links
The IRS describes the special rules regarding UBIT here: Unrelated Business Income Tax. For more information, download Publication 598, Tax on Unrelated Business Income of Exempt Organizations.