If you accidentally came across a friend in a public place, you could simply say, "I saw them".
For example, "I saw my friend in the lobby of our apartment and she told me she was coming to the party".
There are also some phrasal verbs that are very commonly used to express the same idea.
The expression "bumped into" is often used for long-time friends that you haven't seen for quite some time.
For example, people say, "You will never guess who I bumped into. I haven't seen Jack for years".
The expression "ran into" is commonly used for people you might see in your daily routine.
For example, people often say, "I ran into my neighbour again at the grocery store. It seems we both do our shopping on Saturday".
The expression "came across" seems to be used for people we don't know as well.
For example, people might say, "I came across that salesman who used to work at the car dealers on North Street. He is working at another place now".
Hope this is some help to you.