What is this?

So this came out of my soon to be mother in law dogs ears. What is this and what's going on? We're getting her to the vet on Friday and we'll be taking these in to let them see, but in the meantime I was wondering what you all could let us know. We've hardly scratched the surface of what all is in her ears because we didn't go too far in with them to keep from hurting her.