In a morally wrong or wicked manner. He foully betrayed his closest friends for personal gain.
In a disgusting or offensive way. The room smelled foully of rotten food and mildew.
In a way that violates the rules of a game or sport. The player was penalized for foully tackling his opponent.