I think this is VERY opinion based due to the situation, so here are my opinions.
First, I agree with @Cyn, put the deal in writing and in detail and signed and dated. Contracts are simple, and if either the best or worst happens, you will want to refer to what you agreed upon to start, before the work went to hell or broke records.
Personally, I would not do this without some share of the income; and my rate would vary from "minimal" at a 50/50 split, to "no thanks" if there is no split.
I would insist on co-authorship (second name is fine).
My personality is my own, but if I wrote half of a best-seller and my friend got $1,000,000 dollars and I got $50,000: I would resent that scenario. Fair is fair, and I don't think either "hours" or "words finished" are a good measure of creative contribution. They simply do not capture the difference between 300 pages of crap and 300 pages readers cannot put down.
For that reason, I would not go in as less than a 40% partner, and even then I'd have to truly love their plot or universe or characters or something about what they have already accomplished. Don't forget your opportunity cost, in those evenings you could be writing your own stuff, or hanging with people you love, or reading books (or books on writing), or watching TV.
And I can make exceptions to that rule if the expenses of marketing or selling the work are being shouldered by my friend; any significant financial risk is worth some % too.
Doing contracts for some company, I typically get 2.5x my "daily job" rate to give up that idle time, and I never take on the role of employee with a friend. With friends, it's a joint venture or nothing. If they want anything else, then I assume they don't think my contribution is really necessary to the success of their project, in which case I am not interested in the participation.
In short, working on this project will almost certainly change your relationship with your friend (same goes for working with family), and you need to engineer things so whether the project succeeds or fails miserably, you have not created resentment by either of you. So you won't resent your share if there is great success, and your friend won't resent what they paid you if the result is a terrible failure.