As a simple example, say that your income is $500 below the top of the 15% bracket and you're considering an investment that will produce $1,000 in income. If you opt to make that investment and receive that income, then you'll be $500 into the 25% tax bracket.
To calculate the marginal tax rate on the investment, you'll need to figure out the additional tax on the new income. In this example, $500 will be taxed at 15% and $500 at 25%. This produces tax of $200, which on income of $1,000 makes the marginal tax from making that investment equal to $200 / $1,000 or 20%.