This is often one of the first questions asked, and for good reason — a ghost writing project can be expensive! Consider, you are hiring a professional probably for a good 3 months of work. You are paying his or her salary.
Now, marketability should really still be the first question, because there is no point in making the investment if there is no market (or if you know the market is just you and a few friends) unless you have the money to do this as a personal project. After that, you need to strike the best possible balance between your preferred writer and a rate you can afford.
Costs can and do vary widely. You may be able to find a writer willing to produce a book for as little as $5000. Others will charge as much as $50,000 and ask for a portion of the royalties!!!
(In very rare cases — usually involving celebrities — a writer will work for nothing up front, expecting much higher than usual payment if the book does succeed. This is legitimate, since in this case the writer is taking on a substantial risk. You will need to make sure you are comfortable with how involved the writer becomes in royalties and other spin-offs. You may want to put a cap on the total possible the writer can earn.)
From my experience, you will generally find ghostwriters charging between $10 and $30,000. Again, go back to the 3-month model, and you are paying a professional salary of $3300 to $10,000 per month. Of course you're more likely to spend $10,000 on a book that only takes 1-2 months to write and $30,000 on a book that takes 3-6 months to write.
Now here's something important to consider: if you can only afford $5000 for a book that will take a few months to write, do you really want to work with the writer who jumps at the chance for those rates? Some will be willing to in order to break into this field, but others may not have work with good reason -- so
be cautious about low rates. The low rate does you no good if you can't get the book published when you're done.
It’s important to also know that writers may charge by the page, by the word, by the hour, or may offer a flat rate for the project. The advantage of the latter is that you know what to budget for the book. On the other hand, if you can arrange for a definite word or page count (give or take), you can then compare this with flat-rate quotes.
For example, I know a writer who was charging 10 cents per word with additional costs for research or other work outside of the writing. So, if you wanted her to research and write a book of around 75,000 words, you'd probably be looking at a final cost of about $10,000. Of course she since found that books take a while to craft and her per-word rates have gone up. This is what most ghostwriters find, and it's why most eventually set their rates at $15-$25,000 for your average book.
By the way ... I recommend that you avoid hourly rates, only because you have no guarantee about how much will be produced in an hour. I know people who were stuck with huge bills for about 10 or 20 pages of finished work. ...