On p42 and pp95-96 of the 3e DMG there are rules and guidelines for creating new spells. The rules in a nutshell:
- Access to a library, just as if the character were researching to learn a spell.
- 1,000gp expenditure per week
- 1 week per spell level
- Spellcraft check of 10 + level of spell means the character was successful.
The text notes that creating spells is easy. Assigning a level is hard. The rest of the text is devoted to guidelines for judging level, power, duration, etc.
The guidelines are very good, in my opinion, but require a lot of DM discretion. For the most part, they recommend comparing the new spell with existing spells to determine the level, but there is also advice about certain effects, costs, etc. The section includes a table with recommended damage caps for Arcane and Divine spells by level.
Information migrated from GMJoe's comments:
There are potential problems with these rules; It is therefore wise to consider them carefully before using them.
They're largely based on the second edition's rules for creating new spells, with the exception of cost: In second edition, the cost of researching a new spell was between 100 and 1000 gp per spell level, with the guideline that the GM should set the actual price high enough that the actual amount should be close to, but not in excess of, the researching PC's available wealth. The apparent purpose and function of these rules in second editon was to reduce the rate at which new spells were introduced to the game, thereby reducing the amount of effort and adaptability required of the GM.
Unlike second edition, 3.5rd edition assumes that the amount of wealth a player character has (and thus the quantity and power of magic items they have access to) is an important part of game balance. Under the rules described above, the cost of researching an orginal spell is a substantial potion of a character's expected wealth at any level, and as a new spell does not significantly alter a character's power level (assuming that the spell is of an appropriate level for its effect) when compared to cheaper power-increasing things a character could spend money on (e.g.: spells learned from other sources, magic items), this means that a character who engages in spell research will actually be less effective then other characters in the same party.
Of course, your milage may vary. Some groups don't care that much about bang-for-gp, or don't strictly adhere to the wealth-by-level chart, some players don't mind shelling out 500-9000 gp for a bit of extra customisation, and in some settings it might be possible to offset the cost original spell research by selling the spell to interested NPCs. Still, given how easily and often 3.5 is played as a numbers game, it might be worth considering replacing some of the gp cost of research with some other requirement.