1. Request the Reviewers' Comments
As they evaluate grant applications, reviewers make comments - and you are entitled to receive those comments. You will usually receive reviewer comments automatically, but if not, obtain them and read them over. They should give you insight into where your proposal fell short of expectations.
Look for "fixable" problems such as missing data in a particular section. Also look for encouraging or discouraging wording in general. Weak scores in a NEEDS or SIGNIFICANCE section, for example, often indicate a mismatch between your goals and those of the funding agency, which you might not be able to address. But wording such as "important problem, but missing xyz..." tells you that a revision would be considered favorably if it addresses the concerns.
2. Review the Winning Applications
Some agencies will provide you with copies of the winning grant aplications if you simply ask. Others will require you to apply to see them under the Freedom of Information Act (FOIA), which takes time, but is not overly burdensome. Frequently, the funding agency posts abstracts of winners online, which can be highly informative.
When you review a number of winning applications, patterns begin to emerge. Learn from the winners and incorporate those lessons into your next application. We frequently do this for clients, and it's led to a higher success rate.
3. Revise and Re-Apply
If you can address the reviewers' concerns, revise your application and re-apply. Unless you're applying for a one-time grant opportunity, most funding opportunities come around once every 1-2 years. If you're rejected one year, apply for the next round for which you are eligible (assuming it still makes sense for your organization, of course). Grant writing involves a bit of trial and error, and you shouldn't necessarily become discouraged by rejection. Plus, reviewer panels may change each cycle, so their impressions can too.
Assuming you had a strong proposal to begin with and you addressed the reviewers' concerns, you can use your past proposal as a foundation for the next round's application.
Also, continue to look for additional funding agencies that might be interested in your work with a re-focus on that agency's priorities. You can leverage your time investment in a single proposal by modifying it for multiple submissions.