The most important thing to do is to incorporate. Look into forming an LLC so that if someone's not happy with what you've done, you're shielded from the guy taking all of your PERSONAL assets.
Second, definitely agree on a contract. Clearly define in your agreement what work is in-scope, because if you don't, you'll create scope creep, and the client won't be happy when you keep having to add additional stuff past the deadline. Remember that contracts can always be amended by the agreement of both parties.
For freelance work, my standard rate is typically anywhere between $55 and $85 hourly. But be sure to bill fairly. Writing one class that adds two numbers is definitely not an hour's worth of time. My rate varies based on the type of work (I charge low usually for design work, for example, because I'm not good at it, but I charge enough to still make money outsourcing - a friend usually would charge $50/hr, minimum 8 hours, to do design work for me, so I charge $55/hr). Development, depending on the client, gets billed at about $85, because I'm good at what I do. If I was going to make a website for the local democratic party, it might be closer to $135/hr.
Be sure to not price yourself too high or too low - too high will disqualify you from the job, and too low will make you seem noobish.