A federal judge on Friday dismissed a lawsuit against Fox News filed by a former on-air host, Andrea Tantaros, who had alleged that the network retaliated against her after she complained about being sexually harassed.

Ms. Tantaros had claimed that Fox News’s founding chairman, Roger Ailes, arranged for her to be illegally surveilled, and that the network’s executives had schemed to create fake social media accounts, known as “sock puppets,” that defamed her online.

On Friday, however, Judge George B. Daniels of the United States District Court for the Southern District of New York wrote that Ms. Tantaros’s allegations were “based primarily on speculation and conjecture.” In dismissing the suit, the judge noted that Ms. Tantaros “fails to adequately make out the basic elements of her claims.”

It was the second legal action against Fox News to conclude this week, as the network looks to move on from a series of scandals that started nearly two years ago. On Tuesday, Fox News reached a $10 million settlement to end a group of racial and gender discrimination lawsuits.