Apple maggot
The apple maggot (Rhagoletis pomonella), also known as the railroad worm (but distinct from the Phrixothrix beetle larva, also called railroad worm), is a species of fruit fly, and a pest of several types of fruits, especially apples. This species evolved about 150 years ago through a sympatric shift from the native host hawthorn to the domesticated apple species Malus domestica in the northeastern United States. This fly is believed to have been accidentally spread to the western United States from the endemic eastern United States region through contaminated apples at multiple points throughout the 20th century. The apple maggot uses Batesian mimicry as a method of defense, with coloration resembling that of the forelegs and pedipalps of a jumping spider (family Salticidae).
The adult form of this insect is about 5 mm (0.20 in) long, slightly smaller than a housefly. The larva, which is the stage of this insect's lifecycle that causes the actual damage to the fruit, is similar to a typical fly larva or maggot. Caterpillars, especially the larvae of the codling moth, that infest the insides of apples are often confused with the apple maggot. However, these organisms generally feed in the apple's core while apple maggots feed on the fruit flesh. The apple maggot larvae are often difficult to detect in infested fruit due to their pale, cream color and small body size. The adult fly lays its eggs inside the fruit. Larvae consume the fruit and cause it to bruise, decay, and finally drop before ripening. The insect overwinters as a pupa in the soil. It only emerges after metamorphosis into a relatively defenseless fly. Adults emerge from late June through September, with their peak flight times occurring in August.()