The money comes from fund raising activities, special interest groups, private donations, business donations.
Campaign finance in the United States is the financing of electoral campaigns at the federal, state, and local levels.
At the federal level, the primary source of campaign funds is individuals; political action committees are a distant second. Contributions from both are limited. These regulated donations are often referred to as hard money. Corporations and trade unions are prohibited from contributing directly to a candidate's campaign. Soft money is funds spent by organizations (such as 527 groups) that are not contributed directly to candidate campaigns, and which do not "expressly advocate" the election or defeat of a candidate. Bundling is the practice of one donor gathering donations from many different individuals in an organization or community and presenting the sum to a campaign.
Public financing is available for Democratic or Republican candidates for President of the United States during the election campaigns during both the primaries and the general election. Eligibility requirements must be fulfilled in order to qualify for public funding and those that do accept public funding are subject to spending limits.
Races for non-federal offices are governed by separate jurisdictions. State offices operate under state law, while races for local offices operate under state law and local ordinances. Over half the states allow some level of corporate contributions. Some states have limits on contributions from individuals that are lower than the national limits, while others have no limits at all.
Campaign finance is a controversial issue, pitting concerns about free speech against concerns about corruption and inequality on the part of those who favor existing or further restrictions.
http://en.wikipedia.org/wiki/Campaign_finance_in_the_United_States
Best wishes.