That is really gross looking but it is fascinating. I hope you can take this to a veterinary school or some place where they can analyze it and discover what it really is, not only to appease curiosity but also for education for when it happens again. Apparently it is not an unheard of event, even if it is very rare.
I like the theory that something small was trapped in the oviduct and over time got layers and layers built up until it was large enough to pass or was forced by a good egg to pass, kind of like a chicken pearl, if you will. (If all pearls looked like this I bet women would quit wearing them!). But, that is strictly theory and not based on any knowledge.
I hope your chook gets back to normal after this and lives a long, healthy life producing good eggs. Please keep us posted if you pursue having it analyzed by a professional.