First too much sun, now too much water. When the 'pearls' turned white, the chlorophyll making cells were dead. The plant couldn't use all that water anymore so rotted. That soil looks really wet. Did you repot when you brought it home? Does that pot have drainage or a built in reservoir? They need fast draining, don't-hold-moisture-against-the-roots potting soil. Something like Miracle Gro Palm and Cactus with about 1/4 to 1/3 perlite mixed in.
Get rid of all the black 'pearls'. Repot in some cactus soil and make sure all the remaining 'pearl' ends are in contact with the soil. Go easy on the water - if you can't feel moisture in the top inch of soil, water. Give it bright light but no direct sun. After it re-roots, it can handle a little more water IF its in a fast draining soil.