I applaud you for looking into more information about this matter and wanting what is best for your mom (because unfortunately so many times people want what is best for themselves instead of what the ill person would have wanted). I strongly encourage you to look into hospice/palliative care soon, as they are the experts on the dying process, and can ensure that all of your questions are answered and that your mom is very comfortable through the entire process.
As to your questions, here is a great link to multiple resources
If she is spitting out her food it sounds like she does not want to eat/has no appetite? If so, this is a normal part of the dying process and does not cause pain. With the body shutting down it can't process/handle food as it used to. I'd recommend if she is refusing to eat, to go with her wishes and not force feed her, as it would just be more traumatizing to her and to you. Feel free to moisten her mouth with a wet sponge as needed to keep her comfortable.
If she is interested in eating, but is pocketing the food or has trouble swallowing, then that is another thing. If she still seems interested in eating, you can buy her thick-it to thicken drinks and spoon feed that to her, and puree the food so she can handle it easier.
Again, calling palliative care/hospice is a great choice, even to just talk with them about her current state and they can help with what to expect next, how she is feeling (what to look out for, signs of pain, etc), and just a shoulder for support. They can evaluate her and let you know if it is the right time to have her in hospice, which it sounds like it is. Its invaluable to have an expert on your side at this tough time. I wish you and your family the best.