Although worker bees are incapable of mating, a small number are able to lay infertile eggs that become drones if conditions in the colony are favourable. In normal circumstances the queen substance that is produced by the queen suppresses the development of workers ovaries, so they are unable to lay eggs. If the queen is absent from a colony for some time the ovaries of a small number of workers develop, so they are able to lay eggs. These are termed "laying workers".
On very rare occasions in queenright colonies some workers lay eggs. This is termed "Anarchic Behaviour".
There is much information available online and I suggest a websearch.
The following are details and abstract on anarchic behaviour of honey bees. This is as it was left by Dave Cushman. Please use the link below for the full paper.
"Measuring the cost of worker reproduction in honeybees: work tempo in an "anarchic" line."
Jonathan R. DAMPNEY, Andrew B. BARRON, Benjamin P. OLDROYD*
School of Biological Sciences A12, University of Sydney, Sydney, NSW 2006, Australia (Received 17 April 2002; revised 1st May 2003; accepted 21 July 2003)
Abstract - Worker reproduction is extremely rare in queen-right honey bee (Apis mellifera) colonies, despite the fact that workers are capable of laying eggs and can potentially increase their direct fitness by doing so. Factors that tip selective forces in favour of functional worker sterility may be related to colony-level costs of worker reproduction. We examined one possible cost by comparing work rates of "anarchist" (a selected line showing high rates of worker reproduction) and wild-type honey bees fostered into anarchic and wildtype host colonies. We observed a lower work rate among anarchist workers compared to wild-type workers. The difference was small but significant and likely contributes to the reduced viability of anarchic colonies. This colony-level cost of anarchistic behaviour counterbalances the increased personal fitness of anarchist bees and partly explains the extreme rarity of anarchic honey bee colonies.
Link to full paper.