In Mass Effect 1 it is only possible to hit enemies by entering melee range and pressing "fire" button.
In Mass Effect 2 you can do the same by pressing "melee" button ("f" is default on PC). You can also charge (run forward) by pressing storm button (spacebar is default on PC).
If the enemy has too much health, your charge won't be very effective. If you play on "casual" difficulty with all strength upgrades, your charge kills easily the weakest enemies with one hit.
Then there is also biotic charge power (ME2 vanguard only)