Book of Vile Darkness has rules for this in Chapter 2: Variant Rules. Pages 26 through 28 describe how sacrifices may be used in conjunction with a Knowledge (religion) check to gain various boons. Examples from Table 2-2: Typical Sacrificial Rewards include 24-hour-long versions of various spells, some entries from the planar binding series, and at the high end, wish. You can also get “virtual” gp and XP for crafting purposes.
In my experience, however, these rules are not very good. They are mostly-meaningless unless you abuse loopholes to game the system (mostly, pump your Knowledge (religion) check to stratospheric levels, which is not hard), at which point they are game-breaking. Which might be rather fitting, but still doesn’t leave you with a fun and engaging play experience.
I have not personally tried any alternatives to these rules, however, so I cannot point out anything better. If nothing else, these exist.