Pills that claim protect your skin from the sun may not work and could even put your health at risk, the Food and Drug Administration said Tuesday.

The federal regulator sent warning letters to five companies for marketing pills and capsules that make unproven claims they protect consumers from the sun. It cited Advanced Skin Brightening Formula, Sunsafe Rx, Solaricare and Sunergetic.

The agency said those products don't meet the FDA's standards for safety and effectiveness and could even put consumers at risk by giving them a false sense of security that a dietary supplement could prevent sunburn, reduce aging or protect from the risks of skin cancer.

"When the FDA sees companies taking advantage of people's desire to protect themselves from the harmful effects of the sun — we'll step in," FDA Commissioner Scott Gottlieb said in a statement. "There's no pill or capsule that can replace your sunscreen."

The FDA isn't authorized to review dietary supplements before they reach the market, but it can pull them if they're found to be unsafe or the claims are false or misleading. In the letters sent Tuesday, the agency has instructed the companies to scrub the violations from product websites and labeling.

Napa Valley Bioscience, which makes Sunsafe Rx, said in an email to CNBC it looks forward to working with the FDA to figure out how it can "best describe the benefits" of its pills and continue offering them.

As for consumers, the agency continues to recommend sunscreen.