Technically neither the browser or server writes an .ASP file. A programmer takes the requirements for a web page and creates a .ASP file that will produce the desired output.
I would describe it this way:
1) a .ASP file is plain-text written by someone (web developer)
2) the .ASP file contains HTML and/or script commands. See the W3Schools tutorial if you would like to see some .ASP code in action. http://www.w3schools.com/asp/default.ASP
3) when someone on the internet requests that web page (ex. http://your_server/your_page.asp) the web server reads in the script file and interprets the contents in order to render the output as HTML
4) the HTML is sent via http to the requester
There are server-side and client side scripting which help make dynamic web pages.
http://en.wikipedia.org/wiki/Server-side_scripting
http://en.wikipedia.org/wiki/Client-side_scripting
Server-side scripts are executed before the HTML is sent back; client-side scripting is where the code is included in the HTML but is executed by the client's browser (JavaScript is a common one)
One key point: if the web server is mis-configured, trying to open a .ASP file should show as plain-text or possible come as a download; this is a bad thing and is a security problem as your code is now exposed.
ASP.NET is the next generation of ASP that uses the .NET framework; many other web page languages exist, including PHP, Ruby on Rails, etc.