The beauty industry has had something of a makeover recently as cosmetics retailers learn an important lesson about selling their goods to millennials: They don't want to buy makeup the same way their moms did.

The clearest evidence of this shift has been the explosive growth of Sephora and Ulta, specialty beauty retailers that have gained traction with shoppers by offering an in-store experience that is distinct in the beauty marketplace.

"Sephora and Ulta have tapped into every little girl's dream of being able to open up their mom's makeup bag and just play," said Stephanie Wissink, a senior research analyst at Piper Jaffray.

Before these stores began popping up at malls across the country, beauty shoppers largely had two choices: buy their makeup at a no-frills drugstore, such as CVS or Duane Reade, or go to a fancy department store counter and let a white-lab-coat-wearing specialist spend an hour dabbing their faces with pricey anti-aging creams.

Sephora and Ulta have tapped into every little girl's dream of being able to open up their mom's makeup bag and just play

Experts say that Sephora and Ulta have filled the wide chasm between those experiences. The stores — carrying an assortment of upscale brands and designed with a trendy look — have a more exclusive luster than a drugstore. And yet, because shoppers can test out all the products for themselves, they feel more accessible than a department store.

By occupying this middle ground, both brands have seen extraordinary growth. Since 2007, Bolingbrook, Illinois-based Ulta Beauty has more than tripled its store count, to about 765. About 50 of those outposts were opened in the third quarter of 2014 alone. In that quarter, Ulta delivered blockbuster results: a 30 percent increase in profit and a 21 percent increase in revenue, growth that was fueled by an increase in the number of transactions at its stores and an uptick in the average value of those transactions. The impressive performance has driven its stock up nearly 59 percent in the last year.

Sephora, which today has 360 North American stores and nearly 1,800 outposts worldwide, is owned by French luxury-goods conglomerate LVMH Moet Hennessy Louis Vuitton. LVMH said in a February earnings announcement that Sephora "had an exceptional year and continued to gain market share." The "selective retailing" division of LVMH, of which Sephora is a cornerstone brand, saw an 8 percent increase in revenue last year.

With an announcement last week that it is opening an Innovation Lab in San Francisco, Sephora telegraphed its seriousness about continuing to increase its market share in this category. The company said the team there will be responsible for developing and testing new technology to be used in its stores and e-commerce operation.

Experts say millennials have flocked to these stores because their setups and merchandise assortments are particularly aligned with what research shows this generation of shoppers prefer.

Today's cosmetics customer is not particularly loyal to any one brand, says Kurt Jetta, the chief executive of Tabs Group, a consumer analytics firm that studies beauty shoppers.

Instead, customers approach buying beauty products as more of a treasure hunt, and the mission is that much easier in a place where you can easily test virtually any product. Plus, both Sephora and Ulta carry a selection of niche, under-the-radar brands, which can be appealing to millennial shoppers who gravitate toward items that give them a sense of individuality.

Karen Grant, a beauty industry analyst with NPD Group, said these specialty stores have created an environment that is well-suited for customers who don't need much help in making their purchases.

"With the explosion of the Web, (shoppers have) more access, and the consumer can do much more research," Grant said. "They don't have to go to a counter to get that education."

The rise of Sephora and Ulta has also pushed traditional beauty players to rethink their strategies. CVS and other drugstores have moved to create splashier, better-lit displays in their beauty aisles to give them a more upscale, experiential vibe. And department stores are moving more products from behind the counter so shoppers can do more testing of their own. In perhaps the clearest concession that customers prefer Sephora's model, J.C. Penney has partnered with the brand to open some 430 "store-within-a-store" Sephoras at J.C. Penney locations across the country.

Direct-selling models such as Avon are also under siege. Why go to a party in someone's home to test makeup when you can do it at the mall on your own time? Although Avon has been weighed down by a number of business woes in recent years, including bribery charges, experts say the change in the cosmetics market may be part of the reason that the brand is struggling to recruit a U.S. sales force and has seen its profits slide in recent quarters.

"Sephora has been the fundamental change agent in the industry," Grant said. "It shifted the dynamic from the traditional brands to kind of becoming a laboratory."