The paper suggests a practical approach to firm valuation based on probabilistic simulation methodology. We develop a model with risky debt and risky tax shield using risk-neutral technique. The model allows investigate dependencies immediately between probabilistic distributions of cash flows to unlevered and levered firm, debt, equity and tax savings. The model also gives a possibility to calculate values and implied time-varying costs of debt, equity, tax shield and levered firm.We consider the risks of cash flows to debt, equity and tax savings from the perspective of redistribution of cash flow to firm before taxes between shareholders, lenders and government. The finding is that interest expense on debt provides protection to both shareholders and lenders. This is because claims of lenders, government and shareholders are subordinated. Interest expense has priority before tax payments, principal payments and residual payments to owners. Therefore cash flow to firm before taxes is firstly used to repay interest payments, then income taxes, then principal payments, and only then forms cash available to owners. The value of tax benefits of lenders can be found by comparing the case of a firm with tax deductions of interest expense with the case of the firm without tax deduction of interest expense.Hence we differentiate between overall tax shield, tax shield of owners and tax shield of lenders. This differentiation is necessary for appropriate firm valuation. We also redefine the objective function of value based management. Financial literature states that the objective of the firm is to maximize the value of levered firm. Instead we show that the objective of the firm should be the maximization of value of levered firm after subtraction of tax shield of lenders. Firms are formed to produce benefits to owners. Owners are not interested in donating tax benefits to lenders. Owners should not seek for overall tax benefits, but instead owners pursue the objective of maximizing only tax benefits they receive.Monte-Carlo simulations discover that the dependence of value of tax benefits of shareholders on financial leverage has an inverted U-shaped form. This is because under high leverage the overall tax savings begin to redistribute mostly to lenders. This means that the optimal capital structure from the owners perspective is not when firm is all-debt financed as suggested by Miller (1988). Instead the maximum value of tax benefits of shareholders is reached much before the firm is financed entirely with debt. However firm value function is never-decreasing, as overall tax shield function cannot be decreasing.We suggest a practical approach to calculate value of debt, value of overall tax savings, value of tax savings of shareholders, value of tax savings of lenders and value of levered equity using data about systematic risk and probability distribution of cash flow to firm. The approach also provides estimates of cost of debt and cost of overall tax savings, as well as costs of tax savings of shareholders and lenders. We also show even for simple perpetuities with fixed absolute amount of contractual debt obligations cost of debt, cost of levered equity and costs of tax savings of different stakeholders do not remain constant as it is often assumed in financial literature, but instead change in time.