That stuff MIGHT be when she is in season and ready for breeding every 4 or 5 days. Does it smell? It should.
However, it might be diarrhea. Do not feed her any lettuce, and get Dri Tail medication from a pet store
. Follow closely the instructions on the back.
Is she lethargic or acting normally?
You need to describe her more, and her symptoms.
There is a chance
it could be a serious infection, either anal or uterine. But you rreally need to tell us more. Also, consider calling a good hamster vet and asking for advice. Good ones will call back for free.
Best of luck.