This was the ninth episode of season one, written by Herbert Wright, based on a story by Larry Forrester, and directed by Rob Bowman. It first aired on November 16, 1987.
I hate this episode,
I hate it so much that this is only the second time I've seen it. I hate for a lot of the same reasons I don't like "The Last Outpost," the first episode to feature the Ferengi. In this case, as in that, it's bad writing, and bad directing. The basic plot here is that a Ferengi vessel approaches the Enterprise with a gift for "the hero of Maxia." That turns out to be Captain Picard, unbeknownst to him, who earlier destroyed a Ferengi ship, without even knowing that they were Ferengi. The gift is his person possessions, recovered from the wreck of his former command, the "Stargazer." Picard, who has been having bizzarre headaches, goes over to the ship. It turns out that the Ferengi Captain wants to frame Picard by making it appear he fired on a ship that had surrendered, and torture him by means of an alien device that causes headache and delusions. Data manages to prove that the records were tinkered with, and Picard is innocent, and the Ferengi, naturally, are vile. If you can stand reading them, there are plot summaries here and here.
I suspect part of the problem with this episode is that it's got three writers involved; Gene Roddenberry, Herbert Wright, and Larry Forrester. I also suspect that the primary story line was the Picard / Ferengi one, and that Roddenberry came up with it, but then first Larry Forrester, and then Herbert Wright who did the actual screenplay, each naturally wanted to add their personal "touch."Wright was one of the TNG producers, with credits on more than 30 episodes. Wright, at Roddenberry's behest, is the one primarily responsible for creating the Ferengi. The Ferengi are deliberately designed to be villains that are avaricious, amoral, and, because of Roddenberry's bizarre notions, sexist and bestial. So we see more of the odd bestial body language in this episode, in contrast to the actions of the Ferengi First officer. This is, then, bad writing, but even so, it's still not as awful as what the writers do to the Wesley Crusher character; after this episode, as Wil Wheaton notes, Wesley is doomed.
The official teaser for "The Battle"
The previous episode was "Justice"; the next episode is "Hide and Q."

