Answer: You can't
Why? Because, like Jiraiya The Gallant mentioned, RAM is limited by what you have installed on your PC (and more specifically, your motherboard).
How do I know this? I build, rebuild, repair, and upgrade both desktops and laptops.
If your friend says he did it with software, it might mean he ALREADY had 4gb of RAM on his platform and his system was slowed down by applications and background processes (thousands of them run without you even noticing). The software most likely force stopped many of them which freed up his RAM. The fact is if you only have 1gb worth of RAM sticks on your computer, then you will never exceed that.