While bylines are not an option for assignments that involve ghostwriting, it's generally a good idea to get a byline whenever possible.
Like any other niche within the writing profession, ghostwriting has its own advantages and disadvantages.
The collaborative nature of ghostwriting can provide a nice break from the solitude of ordinary freelance writing projects.
Some ghostwriting projects allow you the chance to spend time working with well-known people, such as ghostwriting the memoirs of a famous Hollywood actress.
Ghostwriting projects often require that you mimic the style of another writer, instead of expressing yourself as you would normally.