You need to install samba server and make some edits in its config file:
sudo apt-get install samba samba-common
After that you have to edit the file /etc/samba/smb.conf
Just add the following (of course for requirements) to the end of the file:
[SharedFolder1]
comment = My shared folder
read only = yes
path = /home/user/samba/shared_folder1
browsable = yes
guest ok = yes
After that you have to (re-)start the samba server:
sudo service samba restart
If the samba daemon does not automatically start on system start, type the following command:
sudo sysv-rc-conf samba on
Edit: For Loki and Juno (Ubuntu 16.04 / 18.04) the commands are:
sudo systemctl start / stop smbd
for start / stop the server and sudo systemctl enable / disable smbd
for autostart the daemon.
The displayed name in Windows will be "SharedFolder1".
Note: In the example above everyone has access to the folder without a password (guest ok = yes) but only in read-only mode (read-only = yes). Maybe this can also help you.