This is a partly a recall problem. Find a way of distracting him with a squeaky toy for example and then when he looks at you try to recall him and use loads of praise/play with favourite toy kept just for walks/treat. Running off lead is great but you need to practise recall a lot as there will be other situations you don't want him to get involved in as well, e.g. bikes, other dogs on leads (there may be a very good reason why that dog is on a lead, i.e. aggression), etc.
I'd be the last to suggest keep him on a lead as I know how lovely it is to watch them running free. I occasionally have to put mine back on a lead for a short time if neither will leave alone the object of their desire, which might be causing a problem. Ruby took a real dislike to one particular dog the other day and wouldn't stop acting like a terrier and barking and chasing and nipping him no matter what I did so I popped her back on the lead until the owner could take the dog away. Another friend's dog often will only chase one particular jogger.