A method to achieve the optimal design of radiation therapy compensating filters in multibeam situations is proposed. Dose distribution is optimized such that it approaches the prescribed value in the target zone, is minimized everywhere else, and does not exceed designated limits at vulnerable regions. Field shapes, sizes, and weights, together with filter thicknesses that take into account missing tissues and body heterogeneities, are calculated as a result of this process. The dose distribution, after the application of the calculated filters and beams, is also predicted. The method is rigorous, and its accuracy depends only upon the accuracy of the applied dose calculation method. Examples are discussed and verified using data obtained from Theraplan 300L treatment planning system.