Section 501(c)(3) itself states that the tax exemption for charitable, educational, etc. organizations only applies to those organizations
no substantial part of the activities of which is carrying on propaganda, or otherwise attempting, to influence legislation ..., and which does not participate in, or intervene in (including the publishing or distributing of statements), any political campaign on behalf of (or in opposition to) any candidate for public office. [FN1]
This prohibition has two distinct parts. First, a tax exempt organization may not devote a "substantial part" of its activities to attempting to influence legislation. Second, a tax exempt organization is completely barred (even in insubstantial ways) from supporting or opposing candidates for public office. The IRS is particularly concerned about this latter prohibition during election years, and clarified its position in a 2004 news release:
These organizations cannot endorse any candidates, make donations to their campaigns, engage in fund raising, distribute statements, or become involved in any other activities that may be beneficial or detrimental to any particular candidate. Even activities that encourage people to vote for or against a particular candidate on the basis of nonpartisan criteria violate the political campaign prohibition of section 501(c)(3). [FN2]
The Treasury Regulations characterize those entities that engage in lobbying, propaganda or political campaigns (and that are thereby disqualified from a tax exemption) as "action organizations":
[1.501(c)(3)-1(c)(3)](ii) An organization is an action organization if a substantial part of its activities is attempting to influence legislation by propaganda or otherwise. For this purpose, an organization will be regarded as attempting to influence legislation if the organization:
(a) Contacts, or urges the public to contact, members of a legislative body for the purpose of proposing, supporting, or opposing legislation; or
(b) Advocates the adoption or rejection of legislation.
The term legislation, as used in this subdivision, includes action by the Congress, by any State legislature, by any local council or similar governing body, or by the public in a referendum, initiative, constitutional amendment, or similar procedure. An organization will not fail to meet the operational test merely because it advocates, as an insubstantial part of its activities, the adoption or rejection of legislation. ...
(iii) An organization is an action organization if it participates or intervenes, directly or indirectly, in any political campaign on behalf of or in opposition to any candidate for public office.
The term candidate for public office means an individual who offers himself, or is proposed by others, as a contestant for an elective public office, whether such office be national, State, or local. Activities which constitute participation or intervention in a political campaign on behalf of or in opposition to a candidate include, but are not limited to, the publication or distribution of written or printed statements or the making of oral statements on behalf of or in opposition to such a candidate. [FN3]
An organization will also be disqualified under the Treasury regulations as an action organization if "(a) its main or primary objective or objectives (as distinguished from its incidental or secondary objectives) may be attained only by legislation or a defeat of proposed legislation; and (b) it advocates, or campaigns for, the attainment of such main or primary objective or objectives." [FN4]
There are, however, important exceptions to the general limitation on lobbying activity.
1 26 U.S.C. § 501(c)(3).
2 I.R.S. News Release, FS-2004-14 (October 2004).
3 Treas. Reg. § 1.501(c)(3)-1(c)(3)(ii-iii) (as amended in 2008).
4 Treas. Reg. § 1.501(c)(3)-1(c)(3)(iv) (as amended in 2008).